diff options
| author | 2021-03-14 22:27:04 +0000 | |
|---|---|---|
| committer | 2021-03-14 22:27:04 +0000 | |
| commit | c1df836a35ac942136a6fce7448bb5da03b7369b (patch) | |
| tree | 81948a9e7e3a63dc50a9e68c9bf7d0cf2cbb1e03 | |
| parent | Use .gitattributes to normalise line endings on check-in (diff) | |
Separate deploy stage
Separate the build and deploy stage and set the environment value for the deployment stage.
Diffstat (limited to '')
| -rw-r--r-- | .github/workflows/build.yaml | 34 | 
1 files changed, 24 insertions, 10 deletions
| diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 08721dfd..0a006eb9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,7 @@ on:  jobs:    build:      if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' -    name: Build, Push, & Deploy Container +    name: Build & Push      runs-on: ubuntu-latest      steps: @@ -28,15 +28,6 @@ jobs:          with:            path: sir-lancebot -      # Check out the private "kubernetes" repository in the `kubernetes` -      # subdirectory using a GitHub Personal Access Token -      - name: Checkout code -        uses: actions/checkout@v2 -        with: -          repository: python-discord/kubernetes -          token: ${{ secrets.REPO_TOKEN }} -          path: kubernetes -        - name: Set up Docker Buildx          uses: docker/setup-buildx-action@v1 @@ -64,6 +55,29 @@ jobs:            build-args: |              git_sha=${{ github.sha }} +  deploy: +    needs: build +    name: Deploy +    runs-on: ubuntu-latest +    environment: production + +    steps: +      # Create a commit SHA-based tag for the container repositories +      - name: Create SHA Container Tag +        id: sha_tag +        run: | +          tag=$(cut -c 1-7 <<< $GITHUB_SHA) +          echo "::set-output name=tag::$tag" + +      # Check out the private "kubernetes" repository in the `kubernetes` +      # subdirectory using a GitHub Personal Access Token +      - name: Checkout code +        uses: actions/checkout@v2 +        with: +          repository: python-discord/kubernetes +          token: ${{ secrets.REPO_TOKEN }} +          path: kubernetes +        - name: Authenticate with Kubernetes          uses: azure/k8s-set-context@v1          with: | 
