Skip to content

refactor: Add latest tag #6

refactor: Add latest tag

refactor: Add latest tag #6

Workflow file for this run

name: web-app
on:
pull_request:
paths:
- .github/workflows/web-app.yml
- src/web-app/**
push:
branches: [main]
paths:
- .github/workflows/web-app.yml
- src/web-app/**
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm,arm64
- name: Set up buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./src/web-app
file: ./src/web-app/dockerfiles/prod.Dockerfile
push: ${{ github.event_name == 'push' }}
tags: |
ghcr.io/${{ github.repository_owner }}/microservices-example/web-app:build-${{ github.run_number }}
ghcr.io/${{ github.repository_owner }}/microservices-example/web-app:latest
cache-from: type=gha
cache-to: type=gha,mode=max