-
-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (74 loc) · 2.71 KB
/
github-packages-publish.yml
File metadata and controls
75 lines (74 loc) · 2.71 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
name: Publish Docker image to GitHub
on:
push:
workflow_dispatch:
jobs:
push_docker:
name: Push Ubuntu Docker image to GitHub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set $GIT_SHORT_SHA
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub
uses: docker/build-push-action@v2
with:
file: ./Dockerfile.docker
tags: ghcr.io/${{ github.repository_owner }}/ubuntu-docker:${{ env.GIT_SHORT_SHA }}
push: true
push_dind:
needs: push_docker
name: Push Ubuntu DinD image to GitHub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set $GIT_SHORT_SHA
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker pull ghcr.io/${{ github.repository_owner }}/ubuntu-docker:${{ env.GIT_SHORT_SHA }}
- name: Push to GitHub
uses: docker/build-push-action@v2
with:
file: ./Dockerfile.dind
tags: ghcr.io/${{ github.repository_owner }}/ubuntu-dind:${{ env.GIT_SHORT_SHA }}
push: true
build-args: |
REGISTRY=ghcr.io/${{ github.repository_owner }}
TAG=${{ env.GIT_SHORT_SHA }}
push_gha:
needs: [push_docker, push_dind]
name: Push GitHub Actions runner image to GitHub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set $GIT_SHORT_SHA
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker pull ghcr.io/${{ github.repository_owner }}/ubuntu-dind:${{ env.GIT_SHORT_SHA }}
- name: Push to GitHub
uses: docker/build-push-action@v2
with:
tags: ghcr.io/${{ github.repository_owner }}/github-actions-runner:${{ env.GIT_SHORT_SHA }}
push: true
build-args: |
REGISTRY=ghcr.io/${{ github.repository_owner }}
TAG=${{ env.GIT_SHORT_SHA }}