Automatically add next versions #134
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: INTEGRATION CD DISTRIBUTION API | |
concurrency: | |
group: integration-${{ github.ref }} | |
on: | |
pull_request: | |
types: [opened,reopened,synchronize,labeled] | |
jobs: | |
distribution_api_integration: | |
name: Distribution API Integration | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
if: contains(github.event.pull_request.labels.*.name, 'integration-deployment') | |
steps: | |
- name: Checkout the repository 🎁 | |
uses: actions/checkout@v2 | |
- name: 'Authenticating to GCP ⚙️' | |
uses: google-github-actions/auth@v1 | |
with: | |
project_id: core-oss-integration | |
credentials_json: ${{ secrets.G_CREDENTIALS_INTEGRATION }} | |
- name: 'Setting up Cloud SDK 💳' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
- name: Configure gcloud 👷 | |
run: gcloud auth configure-docker europe-west1-docker.pkg.dev | |
- name: Get tag | |
shell: bash | |
id: get_tag | |
run: echo "TAG=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT | |
- name: Build and publish Dockerfile 📦 | |
run: | | |
docker build -f cloud.Dockerfile \ | |
--tag="europe-west1-docker.pkg.dev/core-oss-integration/distribution-api/distribution-api:latest" \ | |
--tag="europe-west1-docker.pkg.dev/core-oss-integration/distribution-api/distribution-api:${{ steps.get_tag.outputs.TAG }}" . | |
docker push europe-west1-docker.pkg.dev/core-oss-integration/distribution-api/distribution-api:latest | |
docker push europe-west1-docker.pkg.dev/core-oss-integration/distribution-api/distribution-api:${{ steps.get_tag.outputs.TAG }} | |
- name: Trigger deploy 🚀 | |
uses: aurelien-baudet/workflow-dispatch@v2 | |
with: | |
workflow: deployment-integration.yml | |
repo: PrestaShopCorp/terraform-core-oss-distribution-api | |
token: ${{ secrets.ACCESS_TOKEN }} | |
ref: 'refs/heads/main' | |
inputs: '{ "version": "${{ steps.get_tag.outputs.TAG }}" }' |