Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fx publish workflow #3

Merged
merged 15 commits into from
Sep 15, 2024
34 changes: 14 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish
---
name: Publish to GHCR

on:
push:
Expand All @@ -8,30 +9,16 @@ on:

jobs:
publish:
name: Publish to GHCR
runs-on: ubuntu-latest

steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: github-app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
permissions:
packages: write
contents: read

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
token: ${{ steps.github-app-token.outputs.token }}
ref: ${{ github.head_ref }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ steps.github-app-token.outputs.token }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -53,6 +40,13 @@ jobs:
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: spartan-ductduong
password: ${{ secrets.PAT }}

- name: Build & push
uses: docker/build-push-action@v4
with:
Expand Down
Loading