Skip to content

Commit

Permalink
Move docker builds into release workflows, either wip or prod (release)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosen committed Feb 13, 2022
1 parent 1ad672f commit 758b467
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 41 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -92,3 +96,34 @@ jobs:
draft: true
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}

container-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
35 changes: 35 additions & 0 deletions .github/workflows/build-release-wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
# push:
# branches: ['wip']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -100,3 +104,34 @@ jobs:
This release contains artifacts that were automatically generated from an unversioned branch of MunkiReport-PHP.
There is no guarantee that this version of MunkiReport-PHP will work at all.
token: ${{ secrets.GITHUB_TOKEN }}

container-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
41 changes: 0 additions & 41 deletions .github/workflows/docker-build-ghcr.yml

This file was deleted.

0 comments on commit 758b467

Please sign in to comment.