Skip to content

Commit 6415678

Browse files
authored
Merge pull request #18 from doob187/master
I've added the secret key to the repo. Sorry this has taken a while. Life's been really busy and I forgot about this one.
2 parents 881b797 + 4b5e27c commit 6415678

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

.github/workflows/docker.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build Multi Stage Docker Image
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'dependabot/**'
6+
schedule:
7+
- cron: '0 5 * * *'
8+
9+
jobs:
10+
GHRC:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/[email protected]
15+
16+
- uses: FranzDiebold/[email protected]
17+
- name: Print environment variables
18+
run: |
19+
echo "CI_REPOSITORY_NAME=$CI_REPOSITORY_NAME"
20+
21+
- name: Prepare GHRC.io
22+
id: prep
23+
run: |
24+
REPO=$CI_REPOSITORY_NAME
25+
DOCKER_IMAGE=${{ github.repository_owner }}/${REPO}
26+
if [ "$CI_REF_NAME" == "master" ];then VERSION=latest;fi
27+
if [ "$CI_REF_NAME" == "dev" ];then VERSION=mightly;fi
28+
if [ "$CI_REF_NAME" == "dockserver" ];then VERSION=dockserver;fi
29+
TAGS="${DOCKER_IMAGE}:${VERSION}"
30+
echo ::set-output name=tags::${TAGS}
31+
echo ::set-output name=title::${GITHUB_REPOSITORY}
32+
echo ::set-output name=version::${VERSION}
33+
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
34+
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v1
37+
with:
38+
platforms: linux/amd64,linux/armhf,linux/arm64
39+
40+
- name: Set up Docker Buildx
41+
id: buildx
42+
uses: docker/[email protected]
43+
44+
- name: Cache Docker layers
45+
uses: actions/[email protected]
46+
with:
47+
path: /tmp/.buildx-cache
48+
key: ${{ runner.os }}-buildx-${{ github.sha }}
49+
restore-keys: |
50+
${{ runner.os }}-buildx-
51+
52+
- name: Login to GitHub Container Registry
53+
if: github.event_name != 'pull_request'
54+
uses: docker/[email protected]
55+
with:
56+
registry: ghcr.io
57+
username: ${{ github.repository_owner }}
58+
password: ${{ secrets.CR_PAT }}
59+
60+
- name: Build and push GHRC.io
61+
id: docker_build
62+
uses: docker/[email protected]
63+
with:
64+
builder: ${{ steps.buildx.outputs.name }}
65+
context: .
66+
file: ./Dockerfile
67+
platforms: linux/amd64,linux/armhf,linux/arm64
68+
push: ${{ github.event_name != 'pull_request' }}
69+
tags: ghcr.io/${{ steps.prep.outputs.tags }}
70+
labels: |
71+
org.opencontainers.image.title=${{ steps.prep.outputs.title }}
72+
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
73+
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
74+
75+
- name: Image digest
76+
run: echo ${{ steps.docker_build.outputs.digest }}

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3-alpine
2+
LABEL org.opencontainers.image.source https://github.com/Red5d/docker-autocompose
23

34
WORKDIR /usr/src/app
45

0 commit comments

Comments
 (0)