fix: Typo in utils randomg string generator #16
Workflow file for this run
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: Build, Release, and Sign Docker Images | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
jobs: | |
build_and_push: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.semantic_release.outputs.version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create and Push Tag | |
id: create_tag | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release_branches: main | |
default_bump: minor | |
create_annotated_tag: true | |
- name: Print the new tags | |
run: | | |
echo "TAG: ${{ steps.create_tag.outputs.new_tag }}" | |
VERSION=$(echo ${{ steps.create_tag.outputs.new_tag }} | sed 's/^v//') | |
echo "VERSION: $VERSION" | |
- name: Install cosign | |
uses: sigstore/[email protected] | |
with: | |
cosign-release: 'v2.2.3' | |
- name: Confirm cosign installation | |
run: cosign version | |
- name: Log in to Docker Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push SHIDAI Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./shidai.Dockerfile | |
push: true | |
tags: ghcr.io/kiracore/sekin/shidai:${{ steps.create_tag.outputs.new_tag }} | |
labels: | |
org.opencontainers.image.authors="kira.network" | |
org.opencontainers.image.url="https://github.com/KiraCore/sekin" | |
org.opencontainers.image.documentation="https://github.com/KiraCore/sekin/blob/main/README.md" | |
org.opencontainers.image.source="https://github.com/KiraCore/sekin.git" | |
org.opencontainers.image.vendor="KIRA" | |
org.opencontainers.image.licenses="CC BY-NC-SA 4.0." | |
org.opencontainers.image.title="SHIDAI" | |
org.opencontainers.image.description="Infra manager" | |
- name: Retrieve SHIDAI image digest | |
id: get-shidai-digest | |
run: | | |
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/kiracore/sekin/shidai:${{ steps.create_tag.outputs.new_tag }}) | |
echo "Digest: $DIGEST" | |
echo "::set-output name=digest::$DIGEST" | |
- name: Sign published SHIDAI Docker image with digest | |
env: | |
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | |
run: | | |
echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key | |
cosign sign --key cosign.key ${{ steps.get-shidai-digest.outputs.digest }} --yes | |
dd if=/dev/zero of=cosign.key bs=1 count=$(stat --format=%s cosign.key) | |
rm -f cosign.key | |
- name: Build and push SYSLOG-NG Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./syslog-ng.Dockerfile | |
push: true | |
tags: ghcr.io/kiracore/sekin/syslog-ng:${{ steps.create_tag.outputs.new_tag }} | |
labels: | |
org.opencontainers.image.authors="kira.network" | |
org.opencontainers.image.url="https://github.com/KiraCore/sekin" | |
org.opencontainers.image.documentation="https://github.com/KiraCore/sekin/blob/main/README.md" | |
org.opencontainers.image.source="https://github.com/KiraCore/sekin.git" | |
org.opencontainers.image.vendor="KIRA" | |
org.opencontainers.image.licenses="CC BY-NC-SA 4.0." | |
org.opencontainers.image.title="syslog-ng" | |
org.opencontainers.image.description="Log server" | |
- name: Retrieve SYSLOG-NG image digest | |
id: get-syslog-digest | |
run: | | |
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/kiracore/sekin/syslog-ng:${{ steps.create_tag.outputs.new_tag }}) | |
echo "Digest: $DIGEST" | |
echo "::set-output name=digest::$DIGEST" | |
- name: Sign published SYSLOG-NG Docker image with digest | |
env: | |
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | |
run: | | |
echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key | |
cosign sign --key cosign.key ${{ steps.get-syslog-digest.outputs.digest }} --yes | |
dd if=/dev/zero of=cosign.key bs=1 count=$(stat --format=%s cosign.key) | |
rm -f cosign.key | |
- name: Update image version in compose.yml | |
run: | | |
sed -i "s/syslog-ng:v[0-9]*\.[0-9]*\.[0-9]*/syslog-ng:${{ steps.create_tag.outputs.new_tag }}/g" compose.yml | |
sed -i "s/shidai:v[0-9]*\.[0-9]*\.[0-9]*/shidai:${{ steps.create_tag.outputs.new_tag }}/g" compose.yml | |
- name: Commit and push updated compose.yml | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add compose.yml | |
git commit -m "fix(cidi_auto): Update compose.yml" \ | |
-m "Update image versions to ${{ steps.create_tag.outputs.new_tag }}" | |
git tag -a ${{ steps.create_tag.outputs.new_tag }} -m "Update image versions to ${{ steps.create_tag.outputs.new_tag }}" | |
git push |