Skip to content

Commit

Permalink
Set up the Docker publish workflow for multiple configs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewL246 authored Jan 4, 2024
1 parent 6f9aa93 commit de65777
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:

jobs:
build-publish:
strategy:
matrix:
config:
- local # Redirect Pretendo requests to a local server (default)
- wiiu # For Wii U network dumps
- 3ds # For 3DS network dumps
runs-on: ubuntu-latest

steps:
Expand All @@ -16,9 +22,14 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up the ${{ matrix.config }} config
run: |
rm ./.mitmproxy/config.yaml
ln -s ./config-${{ matrix.config }}.yaml ./.mitmproxy/config.yaml
- name: Log into the GitHub container registry
if:
${{ github.event != 'pull_request' && github.ref == 'refs/heads/main' }}
${{ github.event != 'pull_request' && github.ref == 'refs/heads/master' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -30,16 +41,19 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=true
flavor: latest=${{ matrix.config == 'local' }}
tags: |
type=ref,event=branch,enable=${{ matrix.config == 'local' }}
type=raw,value=${{ matrix.config }}
type=sha
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push:
${{ github.event != 'pull_request' && github.ref ==
'refs/heads/main' }}
${{ github.event != 'pull_request' && github.ref == 'refs/heads/master' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down

0 comments on commit de65777

Please sign in to comment.