Skip to content

Commit a0406f4

Browse files
committed
Build own docker images and upload to ghcr
1 parent ab2f627 commit a0406f4

File tree

3 files changed

+71
-3
lines changed

3 files changed

+71
-3
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Create docker images and push to ghcr.io
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
docker:
11+
name: Push Docker image
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- dockerfile: ./integration-tests/Dockerfile_alpine3
18+
image: goss_alpine3
19+
- dockerfile: ./integration-tests/Dockerfile_arch
20+
image: goss_arch
21+
- dockerfile: ./integration-tests/Dockerfile_centos7
22+
image: goss_centos7
23+
- dockerfile: ./integration-tests/Dockerfile_trusty
24+
image: goss_trusty
25+
- dockerfile: ./integration-tests/Dockerfile_wheezy
26+
image: goss_wheezy
27+
permissions:
28+
packages: write
29+
contents: read
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Set up QEMU
38+
uses: docker/setup-qemu-action@v3
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
43+
- name: Login to GHCR
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.repository_owner }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Extract metadata (tags, labels) for Docker
51+
id: meta
52+
uses: docker/metadata-action@v5
53+
with:
54+
images: |
55+
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
56+
57+
- name: Build and Push Tag
58+
uses: docker/build-push-action@v5
59+
with:
60+
context: .
61+
file: ${{ matrix.dockerfile }}
62+
push: true
63+
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:latest
64+
labels: ${{ steps.meta.outputs.labels }}
65+
platforms: linux/amd64

integration-tests/Dockerfile_arch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM base/archlinux
1+
FROM archlinux:base
22
MAINTAINER @siddharthist
33

4-
RUN pacman -Sy --noconfirm systemd-sysvcompat
4+
# systemd-sysvcompat is already installed
5+
# RUN pacman -Sy --noconfirm systemd-sysvcompat
56
RUN ln -s /does_not_exist /foo && \
67
chmod 700 ~root
78
RUN mkfifo /pipe

integration-tests/Dockerfile_wheezy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ MAINTAINER Ahmed
44
RUN echo 'deb http://archive.debian.org/debian wheezy main' > /etc/apt/sources.list
55
RUN echo 'deb http://archive.debian.org/debian-security wheezy/updates main' >> /etc/apt/sources.list
66

7-
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && apt-get remove -y vim-tiny && apt-get clean
7+
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install --yes --force-yes \
8+
apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && \
9+
apt-get remove -y vim-tiny && apt-get clean
810

911
RUN chkconfig apache2 on
1012
RUN chkconfig tinyproxy on

0 commit comments

Comments
 (0)