[DPE-3023] Add badges to README.md (#16) #13
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
name: Publish ROCK | |
on: | |
push: | |
branches: | |
- 3-22.04 | |
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: 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: charmed-kafka | |
- 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|split("-"))[0]' rockcraft.yaml) | |
base=$(yq '(.base|split("@"))[1]' rockcraft.yaml) | |
risk=edge | |
tag=${version}-${base}_${risk} | |
channel=$(echo ${{ github.ref_name }} | cut -d "-" -f 1) | |
ROCK_FILE=${{ needs.build.outputs.rock }} | |
sudo skopeo --insecure-policy copy \ | |
oci-archive:$ROCK_FILE \ | |
docker-daemon:ghcr.io/canonical/charmed-kafka:${tag} | |
docker tag \ | |
ghcr.io/canonical/charmed-kafka:${tag} \ | |
ghcr.io/canonical/charmed-kafka:${channel}_${risk} | |
docker push ghcr.io/canonical/charmed-kafka:${tag} | |
docker push ghcr.io/canonical/charmed-kafka:${channel}_${risk} |