From 9ccfbcb063d068374f7698eabae1d5f7854d65c1 Mon Sep 17 00:00:00 2001 From: Atsushi Matsuo Date: Mon, 12 Aug 2024 07:10:24 +0900 Subject: [PATCH] Add files for trying to use GitHub Container Registry --- .github/workflows/publish.yml | 30 ++++++++++++++++++++++++++++++ Dockerfile | 12 ++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 Dockerfile diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..512facd --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish Image + +on: + push: + workflow_dispatch: + +jobs: + publish: + name: Publish Image + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN_202506 }} + - name: Push to GitHub Container Registry + uses: docker/build-push-action@v6 + with: + push: true + tags: matsuo/goss:latest + secrets: | + GIT_AUTH_TOKEN=${{ secrets.GHCR_TOKEN_202506 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..84e2a19 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.22 + +RUN apt update && apt install curl tar make bash git + +WORKDIR /go/src/github.com/goss-org + +ARG GOSS_VERSION="0.4.8" +ARG GOSS_COMMIT_HASH="aed56336c3e8ff683e9540065b502f423dd6760d" + +RUN curl -L https://github.com/goss-org/goss/archive/${GOSS_COMMIT_HASH}.tar.gz | tar -xzvf - + +RUN mv goss-${GOSS_COMMIT_HASH} goss && cd goss && TRAVIS_TAG=${GOSS_VERSION} make build