diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e49069c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Deploy + +on: + push: + tags: + - 'v*' + +jobs: + build-and-push: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Frontend + uses: docker/build-push-action@v4 + with: + context: frontend + push: true + tags: | + ghcr.io/${{ github.repository }}/frontend:latest + ghcr.io/${{ github.repository }}/frontend:${{ github.sha }} + + - name: Build and push Backend + uses: docker/build-push-action@v4 + with: + context: . + file: backend/Dockerfile + push: true + tags: | + ghcr.io/${{ github.repository }}/backend:latest + ghcr.io/${{ github.repository }}/backend:${{ github.sha }}