-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github.ref_name == master in
registry-actions.yml
(#32)
* Add github.ref_name == master in `registry-actions.yml` * Correct username for github packages
- Loading branch information
1 parent
aac3090
commit ab6ef3d
Showing
1 changed file
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ jobs: | |
|
||
publish-rock: | ||
needs: build-rock | ||
if: github.ref_name == 'main' | ||
if: github.ref_name == 'main' || github.ref_name == 'master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
|
@@ -73,25 +73,27 @@ jobs: | |
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push Docker Image (Edge & Latest Channel) | ||
if: github.event.inputs.workflow_choice == 'edge' || github.event.inputs.workflow_choice == 'both' || github.event_name == 'push' || github.event_name == 'workflow_run' | ||
env: | ||
USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
ORG_NAME: ${{ github.repository_owner }} | ||
run: | | ||
IMAGE="$(yq '.name' rockcraft.yaml)" | ||
VERSION="$(yq '.version' rockcraft.yaml)" | ||
ROCK="$(ls *.rock | tail -n 1)" | ||
sudo rockcraft.skopeo --insecure-policy copy oci-archive:"${ROCK}" docker-daemon:"${USERNAME}/${IMAGE}:${VERSION}-edge" | ||
sudo rockcraft.skopeo --insecure-policy copy oci-archive:"${ROCK}" docker-daemon:"${ORG_NAME}/${IMAGE}:${VERSION}-edge" | ||
# Push to Docker Hub | ||
# docker tag ${ORG_NAME}/${IMAGE}:${VERSION}-edge ${USERNAME}:${VERSION}-edge | ||
# docker push ${USERNAME}/${IMAGE}:${VERSION}-edge | ||
# docker tag ${USERNAME}/${IMAGE}:${VERSION}-edge ${USERNAME}/${IMAGE}:latest | ||
# docker push ${USERNAME}/${IMAGE}:latest | ||
# Push to GitHub Packages | ||
GITHUB_IMAGE="ghcr.io/${{ github.repository_owner }}/${IMAGE}" | ||
docker tag ${USERNAME}/${IMAGE}:${VERSION}-edge ${GITHUB_IMAGE}:${VERSION}-edge | ||
GITHUB_IMAGE="ghcr.io/${ORG_NAME}/${IMAGE}" | ||
docker tag ${ORG_NAME}/${IMAGE}:${VERSION}-edge ${GITHUB_IMAGE}:${VERSION}-edge | ||
docker push ${GITHUB_IMAGE}:${VERSION}-edge | ||
docker tag ${GITHUB_IMAGE}:${VERSION}-edge ${GITHUB_IMAGE}:latest | ||
docker push ${GITHUB_IMAGE}:latest | ||
|
@@ -100,14 +102,15 @@ jobs: | |
if: github.event.inputs.workflow_choice == 'stable' || github.event.inputs.workflow_choice == 'both' | ||
env: | ||
USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
ORG_NAME: ${{ github.repository_owner }} | ||
run: | | ||
IMAGE="$(yq '.name' rockcraft.yaml)" | ||
VERSION="$(yq '.version' rockcraft.yaml)" | ||
ROCK="$(ls *.rock | tail -n 1)" | ||
sudo rockcraft.skopeo --insecure-policy copy oci-archive:"${ROCK}" docker-daemon:"${USERNAME}/${IMAGE}:${VERSION}-stable" | ||
sudo rockcraft.skopeo --insecure-policy copy oci-archive:"${ROCK}" docker-daemon:"${ORG_NAME}/${IMAGE}:${VERSION}-stable" | ||
# Push to Docker Hub | ||
# docker push ${USERNAME}/${IMAGE}:${VERSION}-stable | ||
# Push to GitHub Packages | ||
GITHUB_IMAGE="ghcr.io/${{ github.repository_owner }}/${IMAGE}" | ||
docker tag ${USERNAME}/${IMAGE}:${VERSION}-stable ${GITHUB_IMAGE}:${VERSION}-stable | ||
GITHUB_IMAGE="ghcr.io/${ORG_NAME}/${IMAGE}" | ||
docker tag ${ORG_NAME}/${IMAGE}:${VERSION}-stable ${GITHUB_IMAGE}:${VERSION}-stable | ||
docker push ${GITHUB_IMAGE}:${VERSION}-stable |