Skip to content

test workflows

test workflows #11

Workflow file for this run

name: Frontend CI/CD
on:
push:
branches:
- main
paths:
- 'frontend/**'
pull_request:
branches:
- main
paths:
- 'frontend/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set Docker image tag based on commit SHA
id: get-sha
run: echo "::set-output name=sha_tag::$(git rev-parse --short HEAD)"
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/plotter-frontend:${{ steps.get-sha.outputs.sha_tag }} ./frontend
- name: Login to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Push Docker image to DockerHub
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/plotter-frontend:${{ steps.get-sha.outputs.sha_tag }}