diff --git a/.github/workflows/cd-short.yml b/.github/workflows/cd-short.yml index 5efa3cc8..696edef1 100644 --- a/.github/workflows/cd-short.yml +++ b/.github/workflows/cd-short.yml @@ -6,7 +6,7 @@ name: CD-SHORT on: # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [short-old] + branches: [short] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -37,7 +37,7 @@ jobs: "GEOLITE2_LICENSE_KEY=${{ secrets.GEOLITE2_LICENSE_KEY }}" NEXT_PUBLIC_SHORT_DOMAIN=true push: true - tags: ghcr.io/${{ github.repository }}:short-latest + tags: ghcr.io/${{ github.repository }}:short-latest@${{ github.sha }} # deploy: # needs: build # runs-on: ubuntu-latest @@ -55,18 +55,18 @@ jobs: # docker compose up -d # docker system prune -f - # deploy: - # runs-on: ubuntu-latest - # needs: build - # environment: - # name: 'production' - # url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - # steps: - # - name: Deploy to Azure Web App - # id: deploy-to-webapp - # uses: azure/webapps-deploy@v2 - # with: - # app-name: 'dolph-aabiskar' - # slot-name: 'production' - # publish-profile: ${{ secrets.AzureAppService_PublishProfile }} - # images: 'ghcr.io/thanhdanh27600/clickdi:short-latest' + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + steps: + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'dolph-aabiskar' + slot-name: 'production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_34EA2A2C3814419DB187C95DEE1D90FA }} + images: 'ghcr.io/thanhdanh27600/clickdi:short-latest@${{ github.sha }}' diff --git a/.github/workflows/short_dolph-aabiskar.yml b/.github/workflows/short_dolph-aabiskar.yml deleted file mode 100644 index 88fa7d3c..00000000 --- a/.github/workflows/short_dolph-aabiskar.yml +++ /dev/null @@ -1,58 +0,0 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - -name: Build and deploy container app to Azure Web App - dolph-aabiskar - -on: - push: - branches: - - short - workflow_dispatch: - -jobs: - build: - runs-on: 'ubuntu-latest' - - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Decrypt secret - run: ./scripts/decrypt_secret.sh .env.production.gpg ./.env - env: - SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }} - - - name: Log in to registry - uses: docker/login-action@v2 - with: - registry: https://ghcr.io/ - username: ${{ secrets.AzureAppService_ContainerUsername_fce7aa16b14b42228cfff08e0bf30eea }} - password: ${{ secrets.AzureAppService_ContainerPassword_f0d7b2aab3f541168721da1c2f41fbad }} - - - name: Build and push container image to registry - uses: docker/build-push-action@v4 - with: - push: true - build-args: | - NEXT_PUBLIC_SHORT_DOMAIN=true - tags: ghcr.io/${{ secrets.AzureAppService_ContainerUsername_fce7aa16b14b42228cfff08e0bf30eea }}/thanhdanh27600/clickdi:${{ github.sha }} - file: ./Dockerfile - - deploy: - runs-on: ubuntu-latest - needs: build - environment: - name: 'production' - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - - steps: - - name: Deploy to Azure Web App - id: deploy-to-webapp - uses: azure/webapps-deploy@v2 - with: - app-name: 'dolph-aabiskar' - slot-name: 'production' - publish-profile: ${{ secrets.AzureAppService_PublishProfile_34ea2a2c3814419db187c95dee1d90fa }} - images: 'ghcr.io/${{ secrets.AzureAppService_ContainerUsername_fce7aa16b14b42228cfff08e0bf30eea }}/thanhdanh27600/clickdi:${{ github.sha }}'