mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 18:18:55 +00:00
Copy images before deploying production
This commit is contained in:
38
.github/workflows/_deploy_production.yml
vendored
38
.github/workflows/_deploy_production.yml
vendored
@@ -68,6 +68,44 @@ jobs:
|
||||
-t ${{ steps.login-production.outputs.registry }}/firezone/${image}:${MAJOR_MINOR_VERSION} \
|
||||
$SOURCE_TAG
|
||||
done
|
||||
- name: Authenticate to Google Cloud
|
||||
id: auth
|
||||
uses: google-github-actions/auth@v2
|
||||
with:
|
||||
workload_identity_provider: "projects/397012414171/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions"
|
||||
service_account: "github-actions@github-iam-387915.iam.gserviceaccount.com"
|
||||
export_environment_variables: true
|
||||
create_credentials_file: true
|
||||
- name: Copy Google Cloud Storage binaries to "latest" version
|
||||
run: |
|
||||
set -xe
|
||||
|
||||
IMAGES=(firezone-gateway)
|
||||
ARCHITECTURES=(x86_64 aarch64 armv7)
|
||||
MAJOR_VERSION="${VERSION%%.*}"
|
||||
MAJOR_MINOR_VERSION="${VERSION%.*}"
|
||||
|
||||
for image in "${IMAGES[@]}"; do
|
||||
for arch in "${ARCHITECTURES[@]}"; do
|
||||
# Copy sha256sum.txt
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch}.sha256sum.txt \
|
||||
gs://firezone-prod-artifacts/${image}/latest/${arch}.sha256sum.txt
|
||||
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch}.sha256sum.txt \
|
||||
gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}/${arch}.sha256sum.txt
|
||||
|
||||
# Copy binaries
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch} \
|
||||
gs://firezone-prod-artifacts/${image}/latest/${arch}
|
||||
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch} \
|
||||
gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}/${arch}
|
||||
done
|
||||
done
|
||||
|
||||
deploy-production:
|
||||
needs: push
|
||||
|
||||
38
.github/workflows/publish.yml
vendored
38
.github/workflows/publish.yml
vendored
@@ -59,41 +59,3 @@ jobs:
|
||||
-t ghcr.io/firezone/${image}:${MAJOR_MINOR_VERSION} \
|
||||
$SOURCE_TAG
|
||||
done
|
||||
- name: Authenticate to Google Cloud
|
||||
id: auth
|
||||
uses: google-github-actions/auth@v2
|
||||
with:
|
||||
workload_identity_provider: "projects/397012414171/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions"
|
||||
service_account: "github-actions@github-iam-387915.iam.gserviceaccount.com"
|
||||
export_environment_variables: true
|
||||
create_credentials_file: true
|
||||
- name: Copy Google Cloud Storage binaries to "latest" version
|
||||
run: |
|
||||
set -xe
|
||||
|
||||
IMAGES=(firezone-gateway)
|
||||
ARCHITECTURES=(x86_64 aarch64 armv7)
|
||||
MAJOR_VERSION="${VERSION%%.*}"
|
||||
MAJOR_MINOR_VERSION="${VERSION%.*}"
|
||||
|
||||
for image in "${IMAGES[@]}"; do
|
||||
for arch in "${ARCHITECTURES[@]}"; do
|
||||
# Copy sha256sum.txt
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch}.sha256sum.txt \
|
||||
gs://firezone-prod-artifacts/${image}/latest/${arch}.sha256sum.txt
|
||||
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch}.sha256sum.txt \
|
||||
gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}/${arch}.sha256sum.txt
|
||||
|
||||
# Copy binaries
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch} \
|
||||
gs://firezone-prod-artifacts/${image}/latest/${arch}
|
||||
|
||||
gcloud storage cp \
|
||||
gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.sha }}/${arch} \
|
||||
gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}/${arch}
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user