Skip to content

Build Image

Build Image #98

Workflow file for this run

name: Build Image
on:
workflow_run:
workflows: [ 'Create Image Tag' ]
types:
- completed
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: get latest tag
run: |-
git fetch --prune --unshallow
git remote update
echo "LATEST_TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: web
file: web/Dockerfile.staging
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.LATEST_TAG }}
labels: web
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: proxy
file: proxy/Dockerfile.staging
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-proxy:${{ env.LATEST_TAG }}
labels: proxy