-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (60 loc) · 1.96 KB
/
publish.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Publish Docker image
on:
release:
types:
- published
env:
GITHUB_REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/ikev2-strongswan-vpn
DOCKER_REGISTRY_IMAGE: docker.io/aeron/ikev2-strongswan-vpn
jobs:
build:
name: Build and push
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: recase
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.GITHUB_REGISTRY_IMAGE }}
- name: Set up QEMU
uses: docker/[email protected]
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
tags: >-
${{ steps.recase.outputs.lowercase }}:latest
${{ steps.recase.outputs.lowercase }}:${{ github.ref_name }}
${{ env.DOCKER_REGISTRY_IMAGE }}:latest
${{ env.DOCKER_REGISTRY_IMAGE }}:${{ github.ref_name }}
platforms: linux/amd64, linux/arm64
containerfiles: |
./dockerfile
- name: Log into GitHub Container Registry
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Log into Docker Hub
uses: redhat-actions/podman-login@v1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to registries
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ steps.build-image.outputs.tags }}
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: aeron/ikev2-strongswan-vpn
continue-on-error: true