Skip to content

Commit c55e8a7

Browse files
committed
Add release github action workflow
1 parent 0636c8f commit c55e8a7

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: release-docker-image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
github-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Create Release
15+
uses: actions/create-release@v1
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
tag_name: ${{ github.ref }}
20+
release_name: Version ${{ github.ref }}
21+
draft: false
22+
prerelease: false
23+
docker-hub-release:
24+
needs: github-release
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- name: Prepare image metadata
30+
id: metadata
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: zappi/nginx
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
- name: Login to Docker Hub
39+
uses: docker/login-action@v3
40+
with:
41+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
42+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
43+
- name: Build, tag, and push image to Amazon ECR
44+
uses: docker/build-push-action@v6
45+
with:
46+
cache-from: type=gha
47+
cache-to: type=gha,mode=max
48+
context: .
49+
labels: ${{ steps.metadata.outputs.labels }}
50+
platforms: linux/amd64,linux/arm64
51+
push: true
52+
tags: ${{ steps.metadata.outputs.tags }}
53+
- name: Update description on Docker Hub Description
54+
uses: peter-evans/dockerhub-description@v4
55+
with:
56+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
57+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
58+
repository: zappi/nginx

0 commit comments

Comments
 (0)