Skip to content

Commit

Permalink
Gjør github action klar for å bygge og deploye flere image (#24)
Browse files Browse the repository at this point in the history
Gjøres med matrix, tilsvarende det som er gjort på mong/mongr-dev
  • Loading branch information
arnfinn authored Jan 7, 2024
1 parent 88e34cd commit 79dc6d2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,25 @@ concurrency:

jobs:
push_to_registries:
name: Push Docker image to docker hub
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {name: code-server}
name: ${{ matrix.config.name }}
steps:
- name: Check out the repo
uses: actions/checkout@v4.1.1
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: "code-server/Dockerfile"
dockerfile: "${{ matrix.config.name }}/Dockerfile"
- name: Prepare tags
id: docker_meta
uses: docker/metadata-action@v5.4.0
with:
images: rapporteket/code-server
images: rapporteket/${{ matrix.config.name }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -45,7 +50,7 @@ jobs:
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ./code-server/Dockerfile
file: ./${{ matrix.config.name }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
Expand Down

0 comments on commit 79dc6d2

Please sign in to comment.