From ce9cfbd45bb54726491dcd930ade0315a3d3822b Mon Sep 17 00:00:00 2001 From: Jonathan Adshead Date: Fri, 29 Apr 2022 08:58:04 -0700 Subject: [PATCH] chore(workflow): release - checkout tag --- ...se-step-3_automatic_prepare-docker-tags.yml | 4 +++- ...automatic_docker-prod-build-and-publish.yml | 2 ++ ..._automatic_docker-dev-build-and-publish.yml | 2 ++ ...utomatic_publish-one-app-statics-to-npm.yml | 18 ++++++++++-------- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-step-3_automatic_prepare-docker-tags.yml b/.github/workflows/release-step-3_automatic_prepare-docker-tags.yml index 18e2c3bab..baaafcbab 100644 --- a/.github/workflows/release-step-3_automatic_prepare-docker-tags.yml +++ b/.github/workflows/release-step-3_automatic_prepare-docker-tags.yml @@ -15,7 +15,6 @@ jobs: name: Docker Tag Version Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Set env id: set_tag_version run: | @@ -37,6 +36,9 @@ jobs: echo "::error::Incorrect tag provided, please provide a tag with the correct format and try again" exit 1 fi + - uses: actions/checkout@v2 + with: + ref: "${{ steps.set_tag_version.outputs.tagversion}}" - name: Docker tag version id: set_docker_tag_version run: | diff --git a/.github/workflows/release-step-4_automatic_docker-prod-build-and-publish.yml b/.github/workflows/release-step-4_automatic_docker-prod-build-and-publish.yml index 9365ba3c3..e11c39c59 100644 --- a/.github/workflows/release-step-4_automatic_docker-prod-build-and-publish.yml +++ b/.github/workflows/release-step-4_automatic_docker-prod-build-and-publish.yml @@ -13,6 +13,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + ref: "v${{ github.event.inputs.docker_tag_version }}" - name: Docker login run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin - name: Build production docker image diff --git a/.github/workflows/release-step-5_automatic_docker-dev-build-and-publish.yml b/.github/workflows/release-step-5_automatic_docker-dev-build-and-publish.yml index cd4a39f6e..1eb788083 100644 --- a/.github/workflows/release-step-5_automatic_docker-dev-build-and-publish.yml +++ b/.github/workflows/release-step-5_automatic_docker-dev-build-and-publish.yml @@ -13,6 +13,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + ref: "v${{ github.event.inputs.docker_tag_version }}" - name: Docker Image Versions id: set_docker_version run: | diff --git a/.github/workflows/release-step-6-automatic_publish-one-app-statics-to-npm.yml b/.github/workflows/release-step-6-automatic_publish-one-app-statics-to-npm.yml index aca240066..2fc357a00 100644 --- a/.github/workflows/release-step-6-automatic_publish-one-app-statics-to-npm.yml +++ b/.github/workflows/release-step-6-automatic_publish-one-app-statics-to-npm.yml @@ -12,14 +12,6 @@ jobs: name: One App Statics Publish to NPM runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v1 - with: - node-version: '16.x' - registry-url: 'https://registry.npmjs.org' - - name: Docker login - run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin - name: Tag Version id: set_tag_version run: | @@ -29,6 +21,16 @@ jobs: else echo ::set-output name=tagversion::${{ github.event.inputs.tag_version }} fi + - uses: actions/checkout@v2 + with: + ref: "${{ steps.set_tag_version.outputs.tagversion}}" + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v1 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - name: Docker login + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin - name: Extract and zip production statics run: | docker create --name prod ${{ secrets.DOCKER_USER }}/one-app:${{ steps.set_tag_version.outputs.tagversion}}