Skip to content

Commit

Permalink
🏗️
Browse files Browse the repository at this point in the history
  • Loading branch information
w13b3 committed Apr 6, 2024
1 parent f9f7656 commit 680a854
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish image
on:
push:
branches:
- master
pull_request:

env:
BUILD_DEBIAN_TAG: bookworm-20240311-slim
BUILD_TAG: ghcr.io/${{ github.repository_owner }}/redbean-build:${{ github.sha }}

jobs:
build-and-push:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Checkout
uses: actions/[email protected]

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ secrets.GH_USR }}
password: ${{ secrets.GH_PAT }}
logout: true

- name: Build and export build image
uses: docker/[email protected]
with:
load: true
push: false
context: .
file: ./Dockerfile.redbean-build
build-args: BUILD_DEBIAN_TAG=${{ env.BUILD_DEBIAN_TAG }}
tags: |
${{ env.BUILD_TAG }}
- name: Build and push final image
uses: docker/[email protected]
with:
push: true
context: .
file: ./Dockerfile.redbean-scratch
build-args: |
GIT_REPO_OWNER=${{ github.repository_owner }}
BUILD_TAG=${{ github.sha }}
tags: |
ghcr.io/${{ github.repository_owner }}/redbean:latest

0 comments on commit 680a854

Please sign in to comment.