Skip to content

Commit

Permalink
migrate from hub.docker.com -> ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Mar 14, 2023
1 parent 5451ac0 commit e988beb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
# based on https://github.com/docker/build-push-action/blob/master/docs/advanced/tags-labels.md

name: ci

on:
"on":
workflow_dispatch: {}
schedule:
- cron: '0 10 * * 1'
push:
Expand All @@ -13,23 +15,32 @@ on:
pull_request:
branches:
- 'main'
- 'master'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'lsst-it/foreman_envsync'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true

- name: Run the default task
run: bundle exec rake

- name: Build gem
run: gem build *.gemspec

- name: Publish gem to rubygems.org
if: startsWith(github.ref, 'refs/tags/v')
run: gem push *.gem
Expand All @@ -40,18 +51,30 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: |
lsstit/foreman_envsync
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub

- name: Login to OCI registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_LSSTIT_USERNAME }}
password: ${{ secrets.DOCKERHUB_LSSTIT_PASSWORD }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ classes within those puppet environments.
## OCI Image

An OCI image containing this gem is published to docker hub as
[`lsstit/foreman_envsync`](https://hub.docker.com/repository/docker/lsstit/foreman_envsync).
[`ghcr.io/lsst-it/foreman_envsync`](ghcr.io/lsst-it/foreman_envsync).


## The Problem
Expand Down

0 comments on commit e988beb

Please sign in to comment.