Add env variables #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker Images | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- dockerfile: ./HadesAPI/Dockerfile | |
image: ghcr.io/mtze/hades/hades-api | |
- dockerfile: ./HadesScheduler/Dockerfile | |
image: ghcr.io/mtze/hades/hades-schduler-k8s | |
steps: | |
- name: Compute Tag | |
uses: actions/github-script@v6 | |
id: compute-tag | |
with: | |
result-encoding: string | |
script: | | |
if (context.eventName === "pull_request") { | |
return "pr-" + context.issue.number; | |
} | |
if (context.eventName === "push") { | |
if (context.ref.startsWith("refs/tags/")) { | |
return context.ref.slice(10); | |
} | |
if (context.ref === "refs/heads/develop") { | |
return "develop"; | |
} | |
} | |
return "latest"; | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Install Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push Docker Image | |
uses: docker/build-push-action@v4 | |
with: | |
file: ${{ matrix.dockerfile }} | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ matrix.image }}:${{ steps.compute-tag.outputs.result }} |