Skip to content

Commit

Permalink
feat(ci): Perform release jobs to GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
whisperity committed May 22, 2024
1 parent d3a41e3 commit e64523b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.git
.github
LICENSE
README.md
22 changes: 21 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ name: "Docker Image CI"
on:
push:
pull_request:
workflow_dispatch:
inputs:
release:
type: boolean
description: "Release the built Docker image into 'ghcr.io'"

jobs:
build:
name: "Build Docker Image"
name: "Build ${{ github.event_name == 'workflow_dispatch' && inputs.release && 'and Deploy' || '' }} Docker Image"
env:
RUNS_ON: "ubuntu-20.04"
permissions:
packages: write
runs-on: "ubuntu-20.04"
steps:
- name: "Build Docker Image"
Expand All @@ -26,3 +33,16 @@ jobs:
-- \
bash -c \
"ps fauxw; /usr/bin/ls -alh .; /usr/bin/ls -alh /var/log; cat /var/log/*; exit;"
- name: "Log in to GitHub Container Registry (GHCR)"
if: "github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && inputs.release"
uses: docker/login-action@v3
with:
registry: "ghcr.io"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: "Upload image to GHCR"
if: "github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && inputs.release"
uses: docker/build-push-action@v5
with:
push: true
tags: "ghcr.io/${{ github.actor }}/distcc-docker:${{ env.RUNS_ON }}"

0 comments on commit e64523b

Please sign in to comment.