tangled
alpha
login
or
join now
vicwalker.dev.br
/
pds-mirror
0
fork
atom
Mirror from bluesky-social/pds
0
fork
atom
overview
issues
pulls
pipelines
initial github workflow to build and push to ghcr
Devin Ivy
2 years ago
dd86ea30
a39d62dc
+57
1 changed file
expand all
collapse all
unified
split
.github
workflows
build-and-push-ghcr.yaml
+57
.github/workflows/build-and-push-ghcr.yaml
···
1
1
+
name: build-and-push-ghcr
2
2
+
on:
3
3
+
push:
4
4
+
branches:
5
5
+
- main
6
6
+
env:
7
7
+
REGISTRY: ghcr.io
8
8
+
USERNAME: ${{ github.actor }}
9
9
+
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
10
10
+
11
11
+
# github.repository as <account>/<repo>
12
12
+
IMAGE_NAME: ${{ github.repository }}
13
13
+
14
14
+
jobs:
15
15
+
pds-container-ghcr:
16
16
+
runs-on: ubuntu-latest
17
17
+
permissions:
18
18
+
contents: read
19
19
+
packages: write
20
20
+
id-token: write
21
21
+
22
22
+
steps:
23
23
+
- name: Checkout repository
24
24
+
uses: actions/checkout@v3
25
25
+
26
26
+
- name: Setup Docker buildx
27
27
+
uses: docker/setup-buildx-action@v2
28
28
+
29
29
+
- name: Log into registry ${{ env.REGISTRY }}
30
30
+
uses: docker/login-action@v2
31
31
+
with:
32
32
+
registry: ${{ env.REGISTRY }}
33
33
+
username: ${{ env.USERNAME }}
34
34
+
password: ${{ env.PASSWORD }}
35
35
+
36
36
+
- name: Extract Docker metadata
37
37
+
id: meta
38
38
+
uses: docker/metadata-action@v4
39
39
+
with:
40
40
+
images: |
41
41
+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42
42
+
tags: |
43
43
+
type=sha,enable=true,priority=100,suffix=,format=long
44
44
+
45
45
+
- name: Build and push Docker image
46
46
+
id: build-and-push
47
47
+
uses: docker/build-push-action@v4
48
48
+
with:
49
49
+
context: .
50
50
+
push: ${{ github.event_name != 'pull_request' }}
51
51
+
file: ./Dockerfile
52
52
+
tags: |
53
53
+
latest
54
54
+
${{ steps.meta.outputs.tags }}
55
55
+
labels: ${{ steps.meta.outputs.labels }}
56
56
+
cache-from: type=gha
57
57
+
cache-to: type=gha,mode=max