Skip to content

Commit 3055864

Browse files
committed
refactor: tidy
1 parent b6064a1 commit 3055864

File tree

1 file changed

+1
-172
lines changed

1 file changed

+1
-172
lines changed

.github/workflows/deploy.yaml

+1-172
Original file line numberDiff line numberDiff line change
@@ -12,178 +12,7 @@ on:
1212
- main
1313
workflow_dispatch:
1414

15-
# env:
16-
# RESOURCE_GROUP: rg-poorclaresarundel
17-
# REGISTRY: ghcr.io
18-
# IMAGE_NAME: ${{ github.repository }}
19-
# BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
20-
2115
jobs:
22-
run-build-and-deploy:
16+
build-and-deploy:
2317
uses: ./.github/workflows/shared-build-and-deploy.yaml
2418
secrets: inherit
25-
# build:
26-
# runs-on: ubuntu-latest
27-
# strategy:
28-
# matrix:
29-
# services: [{ "imageName": "node-service" }]
30-
# permissions:
31-
# contents: read
32-
# packages: write
33-
# outputs:
34-
# image-node: ${{ steps.image-tag.outputs.image-node-service }}
35-
# sha-short: ${{ steps.sha_short.outputs.sha_short }}
36-
# steps:
37-
# - name: Checkout repository
38-
# uses: actions/checkout@v4
39-
40-
# - name: Set SHA_SHORT environment variable
41-
# id: sha_short
42-
# run: echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
43-
44-
# - name: Check SHA_SHORT environment variable
45-
# run: echo ${{ steps.sha_short.outputs.sha_short }}
46-
47-
# # - name: Dump GitHub context
48-
# # env:
49-
# # GITHUB_CONTEXT: ${{ toJSON(github) }}
50-
# # run: echo "$GITHUB_CONTEXT"
51-
# # - name: Dump job context
52-
# # env:
53-
# # JOB_CONTEXT: ${{ toJSON(job) }}
54-
# # run: echo "$JOB_CONTEXT"
55-
# # - name: Dump steps context
56-
# # env:
57-
# # STEPS_CONTEXT: ${{ toJSON(steps) }}
58-
# # run: echo "$STEPS_CONTEXT"
59-
# # - name: Dump runner context
60-
# # env:
61-
# # RUNNER_CONTEXT: ${{ toJSON(runner) }}
62-
# # run: echo "$RUNNER_CONTEXT"
63-
# # - name: Dump strategy context
64-
# # env:
65-
# # STRATEGY_CONTEXT: ${{ toJSON(strategy) }}
66-
# # run: echo "$STRATEGY_CONTEXT"
67-
# # - name: Dump matrix context
68-
# # env:
69-
# # MATRIX_CONTEXT: ${{ toJSON(matrix) }}
70-
# # run: echo "$MATRIX_CONTEXT"
71-
72-
# # Login against a Docker registry except on PR
73-
# # https://github.com/docker/login-action
74-
# - name: Log into registry ${{ env.REGISTRY }}
75-
# if: github.event_name != 'pull_request'
76-
# uses: docker/login-action@v3
77-
# with:
78-
# registry: ${{ env.REGISTRY }}
79-
# username: ${{ github.actor }}
80-
# password: ${{ secrets.GITHUB_TOKEN }}
81-
82-
# # Extract metadata (tags, labels) for Docker
83-
# # https://github.com/docker/metadata-action
84-
# - name: Extract Docker metadata
85-
# id: meta
86-
# uses: docker/metadata-action@v5
87-
# with:
88-
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}
89-
# tags: |
90-
# type=semver,pattern={{version}}
91-
# type=semver,pattern={{major}}.{{minor}}
92-
# type=semver,pattern={{major}}
93-
# type=ref,event=branch
94-
# type=sha
95-
96-
# # Build and push Docker image with Buildx (don't push on PR)
97-
# # https://github.com/docker/build-push-action
98-
# - name: Build and push Docker image
99-
# uses: docker/build-push-action@v6
100-
# with:
101-
# context: ./
102-
# push: ${{ github.event_name != 'pull_request' }}
103-
# tags: ${{ steps.meta.outputs.tags }}
104-
# labels: ${{ steps.meta.outputs.labels }}
105-
106-
# - name: Output image tag
107-
# id: image-tag
108-
# run: |
109-
# name=$(echo "image-${{ matrix.services.imageName }}" | tr '[:upper:]' '[:lower:]')
110-
# value=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}:sha-${{ steps.sha_short.outputs.sha_short }}" | tr '[:upper:]' '[:lower:]')
111-
# echo "setting output: $name=$value"
112-
# echo "$name=$value" >> $GITHUB_OUTPUT
113-
114-
# deploy:
115-
# runs-on: ubuntu-latest
116-
# if: github.event_name != 'pull_request'
117-
# needs: [build]
118-
# permissions:
119-
# id-token: write
120-
# contents: read
121-
# packages: write
122-
# steps:
123-
# - name: Checkout repository
124-
# uses: actions/checkout@v4
125-
126-
# - name: "AZ CLI login"
127-
# uses: azure/login@v2
128-
# with:
129-
# client-id: ${{ secrets.AZURE_CLIENT_ID }}
130-
# tenant-id: ${{ secrets.AZURE_TENANT_ID }}
131-
# subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
132-
133-
# - name: Deploy bicep
134-
# uses: azure/CLI@v2
135-
# with:
136-
# # azcliversion: 2.63.0 # pinning because https://github.com/Azure/cli/issues/165
137-
# inlineScript: |
138-
# REF_SHA="${{ env.BRANCH_NAME }}.${{ needs.build.outputs.sha-short }}"
139-
# DEPLOYMENT_NAME="${REF_SHA////-}"
140-
# echo "DEPLOYMENT_NAME=$DEPLOYMENT_NAME"
141-
142-
# TAGS='{"owner":"johnnyreilly", "email":"johnny_reilly@hotmail.com"}'
143-
# az deployment group create \
144-
# --resource-group ${{ env.RESOURCE_GROUP }} \
145-
# --name "$DEPLOYMENT_NAME" \
146-
# --template-file ./infra/main.bicep \
147-
# --parameters \
148-
# webServiceImage='${{ needs.build.outputs.image-node }}' \
149-
# containerRegistry=${{ env.REGISTRY }} \
150-
# containerRegistryUsername=${{ github.actor }} \
151-
# containerRegistryPassword=${{ secrets.PACKAGES_TOKEN }} \
152-
# workspaceName='shared-log-analytics' \
153-
# appInsightsName='shared-app-insights' \
154-
# managedEnvironmentName='shared-env' \
155-
# webServiceContainerAppName='${{ env.BRANCH_NAME }}-web' \
156-
# tags="$TAGS" \
157-
# APPSETTINGS_API_KEY="${{ secrets.APPSETTINGS_API_KEY }}" \
158-
# APPSETTINGS_DOMAIN="${{ vars.APPSETTINGS_DOMAIN }}" \
159-
# APPSETTINGS_PRAYER_REQUEST_FROM_EMAIL="${{ vars.APPSETTINGS_PRAYER_REQUEST_FROM_EMAIL }}" \
160-
# APPSETTINGS_PRAYER_REQUEST_RECIPIENT_EMAIL="${{ vars.APPSETTINGS_PRAYER_REQUEST_RECIPIENT_EMAIL }}"
161-
162-
# CONTAINER_APP_URL=$(az containerapp show \
163-
# --resource-group '${{ env.RESOURCE_GROUP }}' \
164-
# --name '${{ env.BRANCH_NAME }}-web' \
165-
# --query properties.configuration.ingress.fqdn \
166-
# --output tsv)
167-
168-
# echo "CONTAINER_APP_URL=$CONTAINER_APP_URL"
169-
170-
# # echo "az deployment group show --resource-group '${{ env.RESOURCE_GROUP }}' --name $DEPLOYMENT_NAME"
171-
# # DEPLOYMENT_OUTPUTS=$(az deployment group show \
172-
# # --resource-group ${{ env.RESOURCE_GROUP }} \
173-
# # --name $DEPLOYMENT_NAME \
174-
# # --query properties.outputs)
175-
176-
# # echo 'convert outputs to variables'
177-
# # echo $DEPLOYMENT_OUTPUTS | jq -c '. | to_entries[] | [.key, .value.value]' |
178-
# # while IFS=$"\n" read -r c; do
179-
# # OUTPUT_NAME=$(echo "$c" | jq -r '.[0]')
180-
# # OUTPUT_VALUE=$(echo "$c" | jq -r '.[1]')
181-
# # echo "setting variable $OUTPUT_NAME=$OUTPUT_VALUE"
182-
# # echo "{$OUTPUT_NAME}={$OUTPUT_VALUE}" >> $GITHUB_OUTPUT
183-
# # # echo "::set-output name=$OUTPUT_NAME::$OUTPUT_VALUE"
184-
# # done # --query properties.outputs.nodeUrl
185-
186-
# # az containerapp show \
187-
# # --resource-group 'rg-poorclaresarundel' \
188-
# # --name 'main-web' \
189-
# # --query properties.configuration.ingress.fqdn

0 commit comments

Comments
 (0)