-
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (51 loc) · 1.98 KB
/
webapp-docker-release-on-tag-docker-hub.yml
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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# branches: [ master ]
name: WebApp Docker Release on tag for docker hub
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Set output for tags
id: pushtags
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Inspect Docker Buildx
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and push ${{ steps.pushtags.outputs.tag }}
id: docker_build
uses: docker/build-push-action@v6
with:
context: ./starsky
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/starsky:latest
${{ secrets.DOCKER_HUB_USERNAME }}/starsky:${{ steps.pushtags.outputs.tag }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.pushtags.outputs.tag }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}