chore(deps): update dependency mozilla/sops to v3.11.0 (#113) #123
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| env: | |
| REGISTRY: ghcr.io | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| refs: | |
| name: Prepare CI Vars | |
| runs-on: ubuntu-18.04 | |
| outputs: | |
| sha_short: ${{ steps.refs.outputs.sha_short }} | |
| short_ref: ${{ steps.refs.outputs.short_ref }} | |
| version: ${{ steps.refs.outputs.version }} | |
| steps: | |
| - name: Source checkout | |
| uses: actions/checkout@v3 | |
| - name: Semantic Release | |
| id: semantic | |
| uses: cycjimmy/semantic-release-action@v2 | |
| with: | |
| dry_run: true | |
| semantic_version: 18 | |
| extra_plugins: | | |
| @semantic-release/changelog | |
| @semantic-release/git | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set outputs | |
| id: refs | |
| run: | | |
| export BRANCH=${GITHUB_REF#refs/*/} | |
| echo "branch: ${BRANCH}" | |
| export BRANCHTRANSLATED=$(echo ${BRANCH} | tr '/' '_') | |
| echo "short_ref: ${BRANCHTRANSLATED}" | |
| export VERSION="" | |
| if ${{ steps.semantic.outputs.new_release_published == 'true' }}; then | |
| export VERSION=${{ steps.semantic.outputs.new_release_version }} | |
| else | |
| export VERSION=${BRANCHTRANSLATED} | |
| fi | |
| echo "New semantic release: ${{ steps.semantic.outputs.new_release_published }}" | |
| echo "version: ${VERSION}" | |
| echo "::set-output name=short_ref::${BRANCHTRANSLATED}" | |
| echo "::set-output name=sha_short::SHA-$(git rev-parse --short=12 HEAD)" | |
| echo "::set-output name=version::${VERSION}" | |
| argocd-image: | |
| name: Build ARGO | |
| needs: refs | |
| runs-on: ubuntu-18.04 | |
| steps: | |
| - name: Source checkout | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ${{ env.REGISTRY }} | |
| - run: ls -la | |
| - uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64 | |
| tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.refs.outputs.sha_short }},${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.refs.outputs.short_ref }} | |
| push: true | |
| release: | |
| name: Semantic Release Images and Artifacts | |
| runs-on: ubuntu-18.04 | |
| needs: [ refs, argocd-image ] | |
| env: | |
| DOCKER_USERNAME: ${{ github.repository_owner }} | |
| DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Source checkout | |
| uses: actions/checkout@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ${{ env.REGISTRY }} | |
| - name: Docker Pull Image | |
| run: docker pull $REGISTRY/$GITHUB_REPOSITORY:${{ needs.refs.outputs.sha_short }} | |
| - name: Run Semantic Release | |
| id: semantic | |
| uses: cycjimmy/semantic-release-action@v2 | |
| with: | |
| dry_run: false | |
| semantic_version: 18 | |
| extra_plugins: | | |
| @semantic-release/changelog | |
| @semantic-release/git | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Echo Semantic Release Versions | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| run: | | |
| echo ${{ steps.semantic.outputs.new_release_version }} | |
| echo ${{ steps.semantic.outputs.new_release_major_version }} | |
| echo ${{ steps.semantic.outputs.new_release_minor_version }} | |
| echo ${{ steps.semantic.outputs.new_release_patch_version }} | |
| - name: Docker Tag Version | |
| run: | | |
| docker tag $REGISTRY/$GITHUB_REPOSITORY:${{ needs.refs.outputs.sha_short }} $REGISTRY/$GITHUB_REPOSITORY:${{ steps.semantic.outputs.new_release_version }} | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| - name: Docker Tag Latest | |
| run: | | |
| docker tag $REGISTRY/$GITHUB_REPOSITORY:${{ needs.refs.outputs.sha_short }} $REGISTRY/$GITHUB_REPOSITORY:latest | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| - name: Docker Push Version | |
| run: | | |
| docker push $REGISTRY/$GITHUB_REPOSITORY:${{ steps.semantic.outputs.new_release_version }} | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| - name: Docker Push Latest | |
| run: | | |
| docker push $REGISTRY/$GITHUB_REPOSITORY:latest | |
| if: steps.semantic.outputs.new_release_published == 'true' |