Skip to content

Commit 0cfd331

Browse files
authored
Merge pull request #8 from SocialGouv/feat/modify-action-push-ghcr
feat: modify action to push to ghcr
2 parents 8a66387 + 9cd7315 commit 0cfd331

1 file changed

Lines changed: 13 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,45 @@
11
name: ci
22

33
on:
4-
schedule:
5-
- cron: "0 10 * * *"
64
push:
7-
branches:
8-
- "**"
9-
tags:
10-
- "v*.*.*"
11-
pull_request:
125
branches:
136
- "main"
147
workflow_dispatch:
158

169
jobs:
1710
docker:
1811
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
1915
steps:
20-
-
21-
name: Checkout
16+
- name: Checkout
2217
uses: actions/checkout@v3
23-
-
24-
name: Docker meta
18+
- name: Docker meta
2519
id: meta
2620
uses: docker/metadata-action@v4
2721
with:
2822
images: |
29-
lsagetlethias/charon
23+
ghcr.io/${{ github.repository }}
3024
tags: |
3125
type=schedule
3226
type=ref,event=branch
3327
type=ref,event=pr
3428
type=semver,pattern={{version}}
3529
type=semver,pattern={{major}}.{{minor}}
3630
type=semver,pattern={{major}}
37-
-
38-
name: Set up QEMU
31+
- name: Set up QEMU
3932
uses: docker/setup-qemu-action@v2
40-
-
41-
name: Set up Docker Buildx
33+
- name: Set up Docker Buildx
4234
uses: docker/setup-buildx-action@v2
43-
-
44-
name: Login to Docker Hub
35+
- name: Login to GHCR
4536
if: github.event_name != 'pull_request'
4637
uses: docker/login-action@v2
4738
with:
48-
username: ${{ secrets.DOCKERHUB_USERNAME }}
49-
password: ${{ secrets.DOCKERHUB_TOKEN }}
50-
-
51-
name: Build and push
39+
registry: ghcr.io
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
- name: Build and push
5243
uses: docker/build-push-action@v4
5344
with:
5445
context: .

0 commit comments

Comments
 (0)