Skip to content

Commit 5ffb017

Browse files
committed
ci: configure github actions to release docker image
1 parent 7e04e10 commit 5ffb017

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Diff for: .github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
name: release
3+
4+
on:
5+
push:
6+
tags:
7+
- "*"
8+
9+
jobs:
10+
image:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v2
15+
16+
- name: Login to GitHub Container Registry
17+
uses: docker/login-action@v1
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.repository_owner }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Build and Push Docker Image
24+
uses: docker/build-push-action@v2
25+
with:
26+
push: true
27+
tags: |
28+
ghcr.io/${{ github.repository }}:${{ github.sha }}
29+
ghcr.io/${{ github.repository }}:latest
30+
31+
- name: Export tgz
32+
run: |
33+
docker save ghcr.io/${{ github.repository }}:latest | gzip > gitpod-azure-aks-guide.tgz
34+
35+
- name: Release
36+
uses: ncipollo/release-action@v1
37+
if: startsWith(github.ref, 'refs/tags/')
38+
with:
39+
artifacts: gitpod-azure-aks-guide.tgz
40+
allowUpdates: true
41+
artifactErrorsFailBuild: true
42+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)