Skip to content

Commit

Permalink
ci: build and publish the Docker image on ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha committed Jul 12, 2023
1 parent 56c6237 commit 3813b79
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and publish Docker container

on:
push:
branches:
- main
- ghcr

jobs:
build-and-publish:
name: Build and publish Docker container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Login to Packages Container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: docker build --tag ghcr.io/jsha/unboundtest:latest .

- name: Push
run: docker push ghcr.io/jsha/unboundtest:latest
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:lunar
LABEL org.opencontainers.image.source=https://github.com/jsha/unboundtest
ENV DEBIAN_FRONTEND noninteractive
RUN apt update && apt -y install unbound golang-go ca-certificates
COPY . /unboundtest
Expand Down

0 comments on commit 3813b79

Please sign in to comment.