-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathupload_release_ghcr_container.yaml
More file actions
47 lines (39 loc) · 1.38 KB
/
upload_release_ghcr_container.yaml
File metadata and controls
47 lines (39 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build and upload GHCR container
on:
workflow_run:
workflows: ["Upload Artifact as GitHub Release Attachment"]
types: [completed]
jobs:
upload_container:
name: Upload Container
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: artifact
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: rpm
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Lowercase repository name
run: echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Build Image'
run: |
docker buildx build --output type=docker --tag ghcr.io/${{ env.REPO_LC }}/app:${{ github.event.workflow_run.head_branch }} --tag ghcr.io/${{ env.REPO_LC }}/app:latest . -f ./Dockerfile
docker push ghcr.io/${{ env.REPO_LC }}/app --all-tags