|
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - main |
| 8 | + - patch/3967 |
8 | 9 | tags: |
9 | 10 | # pre-release tag |
10 | 11 | - "202[3-9].[0-9][0-9].[0-9]+-rc[0-9]+" |
|
68 | 69 | tests-pytest: |
69 | 70 | needs: [setup] |
70 | 71 | uses: ./.github/workflows/tests-pytest.yml |
71 | | - if: ${{ needs.setup.outputs.is_tag == 'true' }} |
| 72 | + # if: ${{ needs.setup.outputs.is_tag == 'true' }} |
72 | 73 | with: |
73 | 74 | parent_event: ${{ github.event_name }} |
74 | 75 |
|
@@ -117,102 +118,102 @@ jobs: |
117 | 118 | - name: Write commit SHA to file |
118 | 119 | run: echo "${{ github.sha }}" >> benefits/static/sha.txt |
119 | 120 |
|
120 | | - - name: Docker Login to GitHub Container Registry |
121 | | - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 |
122 | | - with: |
123 | | - registry: ghcr.io |
124 | | - username: ${{ github.actor }} |
125 | | - password: ${{ secrets.GITHUB_TOKEN }} |
126 | | - |
127 | | - - name: Set up Docker Buildx |
128 | | - id: buildx |
129 | | - uses: docker/setup-buildx-action@v4 |
130 | | - |
131 | | - - name: Cache Parameters |
132 | | - id: cache_params |
133 | | - run: | |
134 | | - CACHE_SCOPE="cal-itp" |
135 | | - MAIN_BRANCH_REF="refs/heads/main" |
136 | | -
|
137 | | - echo "cache_from_args=type=gha,scope=${CACHE_SCOPE},ref=${MAIN_BRANCH_REF}" >> $GITHUB_OUTPUT |
138 | | - echo "cache_to_args=type=gha,scope=${CACHE_SCOPE},mode=max,ref=${MAIN_BRANCH_REF}" >> $GITHUB_OUTPUT |
139 | | -
|
140 | | - - name: Build, tag, and push image to GitHub Container Registry |
141 | | - uses: docker/build-push-action@v7 |
142 | | - with: |
143 | | - builder: ${{ steps.buildx.outputs.name }} |
144 | | - build-args: GIT-SHA=${{ github.sha }} |
145 | | - cache-from: ${{ steps.cache_params.outputs.cache_from_args }} |
146 | | - cache-to: ${{ steps.cache_params.outputs.cache_to_args }} |
147 | | - context: . |
148 | | - file: appcontainer/Dockerfile |
149 | | - push: true |
150 | | - tags: ghcr.io/${{ github.repository }}:${{ github.sha }} |
151 | | - |
152 | | - # deploy application service |
153 | | - - name: Deploy to Azure Web App |
154 | | - uses: azure/webapps-deploy@v2 |
155 | | - with: |
156 | | - app-name: ${{ vars.AZURE_WEBAPP_NAME }} |
157 | | - images: ghcr.io/${{ github.repository }}:${{ github.sha }} |
158 | | - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} |
159 | | - |
160 | | - # begin setup to deploy container app |
161 | | - - name: Log in to azure using federated identity credentials |
162 | | - uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3 |
163 | | - with: |
164 | | - client-id: ${{ secrets.AZURE_SP_CLIENT_ID }} |
165 | | - tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
166 | | - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
167 | | - |
168 | | - - name: Setup terraform |
169 | | - uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4 |
170 | | - with: |
171 | | - terraform_version: 1.15.8 # should match TF_VERSION in .devcontainer/Dockerfile |
172 | | - |
173 | | - - name: Initialize terraform and select workspace |
174 | | - working-directory: terraform |
175 | | - run: ./init.sh "${{ needs.setup.outputs.env_name }}" |
176 | | - |
177 | | - - name: Terraform plan |
178 | | - working-directory: terraform |
179 | | - env: |
180 | | - TF_VAR_CONTAINER_TAG: ${{ github.sha }} |
181 | | - TF_VAR_DEVSECOPS_OBJECT_ID: ${{ secrets.TF_VAR_DEVSECOPS_OBJECT_ID }} |
182 | | - TF_VAR_ENGINEERING_GROUP_OBJECT_ID: ${{ secrets.TF_VAR_ENGINEERING_GROUP_OBJECT_ID }} |
183 | | - TF_VAR_sp_apply_object_id: ${{ secrets.AZURE_SP_OBJECT_ID }} |
184 | | - TF_VAR_sp_plan_object_id: ${{ secrets.AZURE_SP_PLAN_OBJECT_ID }} |
185 | | - run: terraform plan -out=tfplan -lock-timeout=5m |
186 | | - |
187 | | - - name: Terraform apply |
188 | | - working-directory: terraform |
189 | | - run: terraform apply -lock-timeout=5m tfplan |
190 | | - |
191 | | - # attach a detailed summary directly to a gh actions job. sensitive values that match repo secrets are automatically redacted |
192 | | - - name: Attach detailed summary to job |
193 | | - uses: borchero/terraform-plan-comment@f585438eda2fa77c6f275994b92aeccd86ef3542 # v3.2.0 |
194 | | - with: |
195 | | - planfile: tfplan |
196 | | - token: ${{ github.token }} |
197 | | - skip-comment: true |
198 | | - working-directory: terraform |
199 | | - |
200 | | - release: |
201 | | - needs: deploy |
202 | | - if: ${{ needs.setup.outputs.is_release =='true' }} |
203 | | - runs-on: ubuntu-latest |
204 | | - permissions: |
205 | | - # https://github.com/softprops/action-gh-release#permissions |
206 | | - contents: write |
207 | | - |
208 | | - steps: |
209 | | - - name: Checkout |
210 | | - uses: actions/checkout@v7 |
211 | | - with: |
212 | | - fetch-depth: 0 |
213 | | - |
214 | | - - name: Release |
215 | | - uses: softprops/action-gh-release@v3 |
216 | | - with: |
217 | | - prerelease: false |
218 | | - generate_release_notes: true |
| 121 | + # - name: Docker Login to GitHub Container Registry |
| 122 | + # uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 |
| 123 | + # with: |
| 124 | + # registry: ghcr.io |
| 125 | + # username: ${{ github.actor }} |
| 126 | + # password: ${{ secrets.GITHUB_TOKEN }} |
| 127 | + |
| 128 | + # - name: Set up Docker Buildx |
| 129 | + # id: buildx |
| 130 | + # uses: docker/setup-buildx-action@v4 |
| 131 | + |
| 132 | + # - name: Cache Parameters |
| 133 | + # id: cache_params |
| 134 | + # run: | |
| 135 | + # CACHE_SCOPE="cal-itp" |
| 136 | + # MAIN_BRANCH_REF="refs/heads/main" |
| 137 | + |
| 138 | + # echo "cache_from_args=type=gha,scope=${CACHE_SCOPE},ref=${MAIN_BRANCH_REF}" >> $GITHUB_OUTPUT |
| 139 | + # echo "cache_to_args=type=gha,scope=${CACHE_SCOPE},mode=max,ref=${MAIN_BRANCH_REF}" >> $GITHUB_OUTPUT |
| 140 | + |
| 141 | + # - name: Build, tag, and push image to GitHub Container Registry |
| 142 | + # uses: docker/build-push-action@v7 |
| 143 | + # with: |
| 144 | + # builder: ${{ steps.buildx.outputs.name }} |
| 145 | + # build-args: GIT-SHA=${{ github.sha }} |
| 146 | + # cache-from: ${{ steps.cache_params.outputs.cache_from_args }} |
| 147 | + # cache-to: ${{ steps.cache_params.outputs.cache_to_args }} |
| 148 | + # context: . |
| 149 | + # file: appcontainer/Dockerfile |
| 150 | + # push: true |
| 151 | + # tags: ghcr.io/${{ github.repository }}:${{ github.sha }} |
| 152 | + |
| 153 | + # # deploy application service |
| 154 | + # - name: Deploy to Azure Web App |
| 155 | + # uses: azure/webapps-deploy@v2 |
| 156 | + # with: |
| 157 | + # app-name: ${{ vars.AZURE_WEBAPP_NAME }} |
| 158 | + # images: ghcr.io/${{ github.repository }}:${{ github.sha }} |
| 159 | + # publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} |
| 160 | + |
| 161 | + # # begin setup to deploy container app |
| 162 | + # - name: Log in to azure using federated identity credentials |
| 163 | + # uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3 |
| 164 | + # with: |
| 165 | + # client-id: ${{ secrets.AZURE_SP_CLIENT_ID }} |
| 166 | + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 167 | + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 168 | + |
| 169 | + # - name: Setup terraform |
| 170 | + # uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4 |
| 171 | + # with: |
| 172 | + # terraform_version: 1.15.8 # should match TF_VERSION in .devcontainer/Dockerfile |
| 173 | + |
| 174 | + # - name: Initialize terraform and select workspace |
| 175 | + # working-directory: terraform |
| 176 | + # run: ./init.sh "${{ needs.setup.outputs.env_name }}" |
| 177 | + |
| 178 | + # - name: Terraform plan |
| 179 | + # working-directory: terraform |
| 180 | + # env: |
| 181 | + # TF_VAR_CONTAINER_TAG: ${{ github.sha }} |
| 182 | + # TF_VAR_DEVSECOPS_OBJECT_ID: ${{ secrets.TF_VAR_DEVSECOPS_OBJECT_ID }} |
| 183 | + # TF_VAR_ENGINEERING_GROUP_OBJECT_ID: ${{ secrets.TF_VAR_ENGINEERING_GROUP_OBJECT_ID }} |
| 184 | + # TF_VAR_sp_apply_object_id: ${{ secrets.AZURE_SP_OBJECT_ID }} |
| 185 | + # TF_VAR_sp_plan_object_id: ${{ secrets.AZURE_SP_PLAN_OBJECT_ID }} |
| 186 | + # run: terraform plan -out=tfplan -lock-timeout=5m |
| 187 | + |
| 188 | + # - name: Terraform apply |
| 189 | + # working-directory: terraform |
| 190 | + # run: terraform apply -lock-timeout=5m tfplan |
| 191 | + |
| 192 | + # # attach a detailed summary directly to a gh actions job. sensitive values that match repo secrets are automatically redacted |
| 193 | + # - name: Attach detailed summary to job |
| 194 | + # uses: borchero/terraform-plan-comment@f585438eda2fa77c6f275994b92aeccd86ef3542 # v3.2.0 |
| 195 | + # with: |
| 196 | + # planfile: tfplan |
| 197 | + # token: ${{ github.token }} |
| 198 | + # skip-comment: true |
| 199 | + # working-directory: terraform |
| 200 | + |
| 201 | + # release: |
| 202 | + # needs: deploy |
| 203 | + # if: ${{ needs.setup.outputs.is_release =='true' }} |
| 204 | + # runs-on: ubuntu-latest |
| 205 | + # permissions: |
| 206 | + # # https://github.com/softprops/action-gh-release#permissions |
| 207 | + # contents: write |
| 208 | + |
| 209 | + # steps: |
| 210 | + # - name: Checkout |
| 211 | + # uses: actions/checkout@v7 |
| 212 | + # with: |
| 213 | + # fetch-depth: 0 |
| 214 | + |
| 215 | + # - name: Release |
| 216 | + # uses: softprops/action-gh-release@v3 |
| 217 | + # with: |
| 218 | + # prerelease: false |
| 219 | + # generate_release_notes: true |
0 commit comments