From 94aee929bd653c969cd5f9f591bbe220a85dc556 Mon Sep 17 00:00:00 2001 From: Aaron Williams Date: Wed, 19 Jul 2023 12:10:04 +0100 Subject: [PATCH] Migrating package from local to shared workflow * Updated deploy and tag-to-release to use the shared workflows repository * Removed package +ref: FS-3221 +semver: minor --- .github/workflows/deploy.yml | 4 ++- .github/workflows/package.yml | 52 ---------------------------- .github/workflows/tag-to-release.yml | 4 ++- 3 files changed, 6 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/package.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9e1642a..6b539cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,6 +28,8 @@ jobs: paketo_build: permissions: packages: write - uses: ./.github/workflows/package.yml + uses: communitiesuk/funding-design-service-workflows/.github/workflows/package.yml@main with: version_to_build: $(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + owner: ${{ github.repository_owner }} + application: funding-design-service-account-store diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml deleted file mode 100644 index d12232c..0000000 --- a/.github/workflows/package.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Use Paketo to package and build python application - -permissions: - packages: write - -on: - workflow_call: - inputs: - version_to_build: - type: string - required: true - -env: - REGISTRY: ghcr.io - DOCKER_IMAGE: funding-service-design-account-store - -jobs: - paketo_build: - runs-on: ubuntu-latest - name: Packaging and building the application - steps: - - uses: buildpacks/github-actions/setup-pack@v5.0.0 - - uses: actions/checkout@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and publish app image - run: "pack build ${{ env.DOCKER_IMAGE }} --builder paketobuildpacks/builder:base" - - - name: Push image - run: | - IMAGE_ID=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.DOCKER_IMAGE }} - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=${{ inputs.version_to_build }} - - # Use Docker `latest` tag convention - [ "$VERSION" == "main" ] && VERSION=latest - - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - - docker tag ${{ env.DOCKER_IMAGE }} $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/tag-to-release.yml b/.github/workflows/tag-to-release.yml index 89d762b..2162222 100644 --- a/.github/workflows/tag-to-release.yml +++ b/.github/workflows/tag-to-release.yml @@ -26,6 +26,8 @@ jobs: needs: tag-to-release permissions: packages: write - uses: ./.github/workflows/package.yml + uses: communitiesuk/funding-design-service-workflows/.github/workflows/package.yml@main with: version_to_build: ${{ needs.tag-to-release.outputs.new_tag }} + owner: ${{ github.repository_owner }} + application: funding-design-service-account-store