Skip to content

Commit 70ef033

Browse files
committed
Adding release workflow
1 parent 4cb2769 commit 70ef033

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed

.github/workflows/release.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Release images to GitHub Repository and DockerHub
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish_github_ubuntu_docker:
8+
name: Push Ubuntu Docker image to GitHub
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out the repo
12+
uses: actions/checkout@v2
13+
- name: Login to GitHub Container Registry
14+
uses: docker/login-action@v1
15+
with:
16+
registry: docker.pkg.github.com
17+
username: ${{ github.repository_owner }}
18+
password: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Push to GitHub
20+
uses: docker/build-push-action@v2
21+
with:
22+
file: ./Dockerfile.docker
23+
tags: |
24+
docker.pkg.github.com/msyea/github-actions-runner/ubuntu-docker:latest
25+
docker.pkg.github.com/msyea/github-actions-runner/ubuntu-docker:${{ github.event.release.tag_name }}
26+
push: true
27+
publish_github_ubuntu_dind:
28+
needs: publish_github_ubuntu_docker
29+
name: Push Ubuntu DinD image to GitHub
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Check out the repo
33+
uses: actions/checkout@v2
34+
- name: Login to GitHub Container Registry
35+
uses: docker/login-action@v1
36+
with:
37+
registry: docker.pkg.github.com
38+
username: ${{ github.repository_owner }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
- run: docker pull docker.pkg.github.com/msyea/github-actions-runner/ubuntu-docker:${{ github.event.release.tag_name }}
41+
- name: Push to GitHub
42+
uses: docker/build-push-action@v2
43+
with:
44+
file: ./Dockerfile.dind
45+
tags: |
46+
docker.pkg.github.com/msyea/github-actions-runner/ubuntu-dind:latest
47+
docker.pkg.github.com/msyea/github-actions-runner/ubuntu-dind:${{ github.event.release.tag_name }}
48+
push: true
49+
build-args: |
50+
REGISTRY=docker.pkg.github.com/msyea/github-actions-runner
51+
TAG=${{ github.event.release.tag_name }}
52+
publish_github_github_actions_runner:
53+
needs: [publish_github_ubuntu_docker, publish_github_ubuntu_dind]
54+
name: Push GitHub Actions runner image to GitHub
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Check out the repo
58+
uses: actions/checkout@v2
59+
- name: Login to GitHub Container Registry
60+
uses: docker/login-action@v1
61+
with:
62+
registry: docker.pkg.github.com
63+
username: ${{ github.repository_owner }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
- run: docker pull docker.pkg.github.com/msyea/github-actions-runner/ubuntu-dind:${{ github.event.release.tag_name }}}
66+
- name: Push to GitHub
67+
uses: docker/build-push-action@v2
68+
with:
69+
tags: |
70+
docker.pkg.github.com/msyea/github-actions-runner/github-actions-runner:latest
71+
docker.pkg.github.com/msyea/github-actions-runner/github-actions-runner:${{ github.event.release.tag_name }}
72+
push: true
73+
build-args: |
74+
REGISTRY=docker.pkg.github.com/msyea/github-actions-runner
75+
TAG=${{ github.event.release.tag_name }}
76+
publish_docker_ubuntu_docker:
77+
name: Push Ubuntu Docker image to Docker Hub
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Check out the repo
81+
uses: actions/checkout@v2
82+
- name: Login to DockerHub
83+
uses: docker/login-action@v1
84+
with:
85+
username: ${{ secrets.DOCKERHUB_USERNAME }}
86+
password: ${{ secrets.DOCKERHUB_TOKEN }}
87+
- name: Push to Docker Hub
88+
uses: docker/build-push-action@v2
89+
with:
90+
file: ./Dockerfile.docker
91+
tags: |
92+
msyea/ubuntu-docker:latest
93+
msyea/ubuntu-docker:${{ github.event.release.tag_name }}
94+
push: true
95+
publish_docker_ubuntu_dind:
96+
needs: publish_docker_ubuntu_docker
97+
name: Push Ubuntu DinD image to Docker Hub
98+
runs-on: ubuntu-latest
99+
steps:
100+
- name: Check out the repo
101+
uses: actions/checkout@v2
102+
- name: Login to DockerHub
103+
uses: docker/login-action@v1
104+
with:
105+
username: ${{ secrets.DOCKERHUB_USERNAME }}
106+
password: ${{ secrets.DOCKERHUB_TOKEN }}
107+
- name: Push to Docker Hub
108+
uses: docker/build-push-action@v2
109+
with:
110+
file: ./Dockerfile.dind
111+
tags: |
112+
msyea/ubuntu-dind:latest
113+
msyea/ubuntu-dind:${{ github.event.release.tag_name }}
114+
push: true
115+
build-args: |
116+
TAG=${{ github.event.release.tag_name }}
117+
publish_docker_github_actions_runner:
118+
needs: [publish_docker_ubuntu_docker, publish_docker_ubuntu_dind]
119+
name: Push GitHub Actions runner image to Docker Hub
120+
runs-on: ubuntu-latest
121+
steps:
122+
- name: Check out the repo
123+
uses: actions/checkout@v2
124+
- name: Login to DockerHub
125+
uses: docker/login-action@v1
126+
with:
127+
username: ${{ secrets.DOCKERHUB_USERNAME }}
128+
password: ${{ secrets.DOCKERHUB_TOKEN }}
129+
- name: Push to Docker Hub
130+
uses: docker/build-push-action@v2
131+
with:
132+
tags: |
133+
msyea/github-actions-runner:latest
134+
msyea/github-actions-runner:${{ github.event.release.tag_name }}
135+
push: true
136+
build-args: |
137+
TAG=${{ github.event.release.tag_name }}

0 commit comments

Comments
 (0)