Skip to content

Commit

Permalink
Add files for trying to use GitHub Container Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuo committed Aug 11, 2024
1 parent 7cef356 commit 2817371
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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: Container meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/matsuo/goss
tags: |
type=raw,value=latest
type=sha,prefix=,suffix=,format=short
- name: Push to GitHub Container Registry
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2817371

Please sign in to comment.