Skip to content

Merge pull request #10 from tpII/gian #10

Merge pull request #10 from tpII/gian

Merge pull request #10 from tpII/gian #10

Workflow file for this run

name: Backend CI/CD
on:
push:
branches:
- main
paths:
- 'backend/**'
pull_request:
branches:
- main
paths:
- 'backend/**'
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-backend:${{ steps.get-sha.outputs.sha_tag }} ./backend
- name: Login to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- name: Push Docker image to DockerHub
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/plotter-backend:${{ steps.get-sha.outputs.sha_tag }}