-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77aca3e
commit 7de58f6
Showing
1 changed file
with
48 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Publish ROCK (beta) | ||
on: | ||
workflow_dispatch: | ||
branches: | ||
- '[0-9]-[0-9][0-9].[0-9][0-9]' | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Docker | ||
run: | | ||
sudo snap install docker | ||
sudo addgroup --system docker; sudo adduser $USER docker | ||
newgrp docker | ||
sudo snap disable docker; sudo snap enable docker | ||
- name: Install skopeo | ||
run: | | ||
sudo snap install --devmode --channel edge skopeo | ||
- name: Install yq | ||
run: | | ||
sudo snap install yq | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: mongodb-rock | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USER }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
- name: Import and push to GHCR | ||
run: | | ||
version=$(yq '(.version)' rockcraft.yaml) | ||
base=$(yq '(.base|split("@"))[1]' rockcraft.yaml) | ||
tag=${version}-${base}_beta | ||
sudo skopeo --insecure-policy copy \ | ||
oci-archive:charmed-mongodb_${version}_amd64.rock \ | ||
docker-daemon:ghcr.io/canonical/charmed-mongodb:${tag} | ||
docker push ghcr.io/canonical/charmed-mongodb:${tag} |