diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-cd.yml similarity index 92% rename from .github/workflows/ci.yml rename to .github/workflows/ci-cd.yml index 77e424a0..9f050c63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-cd.yml @@ -1,4 +1,4 @@ -name: CI +name: CI/CD on: push: @@ -105,6 +105,17 @@ jobs: fi fi + manual-semver: + needs: + - code-quality + - test + if: ${{ startsWith(github.ref, 'refs/tags') }} + uses: climatepolicyradar/reusable-workflows/.github/workflows/semver.yml@main + secrets: inherit + with: + repo-name: navigator-admin-backend + semver-tag: main-${GITHUB_SHA::8} + tag: needs: build uses: climatepolicyradar/reusable-workflows/.github/workflows/tag.yml@main diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml deleted file mode 100644 index be0c0092..00000000 --- a/.github/workflows/debug.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Debug - -on: - workflow_dispatch - -# https://github.com/marketplace/actions/docker-layer-caching -jobs: - tag: - uses: climatepolicyradar/reusable-workflows/.github/workflows/tag.yml@main - with: - repo-name: navigator-admin-backend - semver-tag: main-${GITHUB_SHA::8} - secrets: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} - - release: - needs: tag - uses: climatepolicyradar/reusable-workflows/.github/workflows/release.yml@main - with: - new_tag: ${{ needs.tag.outputs.new_tag }} diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml deleted file mode 100644 index 62be14dc..00000000 --- a/.github/workflows/semver.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Semver Tagging - -on: - push: - tags: - - v* - -env: - DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - -jobs: - tag-main-with-semver: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1.6.1 - - - name: Docker pull, retag and push - run: | - docker pull ${DOCKER_REGISTRY}/navigator-admin-frontend:main-${GITHUB_SHA::8} - docker tag ${DOCKER_REGISTRY}/navigator-admin-frontend:main-${GITHUB_SHA::8} navigator-admin-frontend:main-${GITHUB_SHA::8} - .github/retag-and-push.sh navigator-admin-frontend main-${GITHUB_SHA::8}