Skip to content

Commit

Permalink
Merge pull request #24 from Starfly-13/same-shite-different-registry
Browse files Browse the repository at this point in the history
Modify CI workflow for building to container registry
  • Loading branch information
blinkdog authored Dec 29, 2023
2 parents 3add80c + 8817628 commit 9c04d5b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/cr_publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to Vultr
name: Publish to Docker Registry

on:
workflow_dispatch:
Expand All @@ -15,13 +15,19 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
steps:
# generate the images and tags we'll publish to the registry
# enable built or pulled docker images to be cached
- name: Enable Docker Cache
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}-${{ hashFiles('dependencies.sh') }}

# generate the images and tags that we'll publish to the registry
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
sjc.vultrcr.com/starfly13/starfly13
docker.ss13.host/starfly13
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{date 'YYYYMMDDHHmmss'}}
Expand All @@ -36,12 +42,12 @@ jobs:
uses: docker/setup-buildx-action@v3

# log in to the registry
- name: Login to Vultr Container Registry
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: sjc.vultrcr.com
username: ${{ secrets.VULTR_USERNAME }}
password: ${{ secrets.VULTR_APIKEY }}
registry: docker.ss13.host
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

# build and push to the registry
- name: Build and push
Expand All @@ -51,3 +57,5 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 3 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:

jobs:
Label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check for conflicting PRs
Expand Down
File renamed without changes.

0 comments on commit 9c04d5b

Please sign in to comment.