Remove dig script #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Deployment | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Notify start building docker image | |
env: | |
IRC_NETWORK: ${{ vars.IRC_NETWORK }} | |
IRC_CHANNEL: ${{ vars.IRC_CHANNEL }} | |
WEBHOOK_META_TOKEN: ${{ secrets.WEBHOOK_META_TOKEN }} | |
run: | | |
message="\\u000310> Building ${{ github.repository }} (ref: \\u000f${{ github.sha }}\\u000310)" | |
curl -X POST -H "Authorization: Bearer ${WEBHOOK_META_TOKEN}" \ | |
--max-time 10 \ | |
-H "Content-Type: application/json" \ | |
-d @- https://meta-webhook.infra.rwx.im/trigger <<JSON || true | |
{ | |
"method": "message", | |
"params": { | |
"network": "${IRC_NETWORK}", | |
"channel": "${IRC_CHANNEL}", | |
"message": "${message}" | |
} | |
} | |
JSON | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: ghcr.io/rwx-labs/meta-oss | |
tags: | | |
type=sha,format=long | |
type=edge | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
- name: Log in to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Notify about pending deployment | |
env: | |
IRC_NETWORK: ${{ vars.IRC_NETWORK }} | |
IRC_CHANNEL: ${{ vars.IRC_CHANNEL }} | |
META_WEBHOOK_TOKEN: ${{ secrets.WEBHOOK_META_TOKEN }} | |
MESSAGE: |- | |
mk: meta-oss is pending deployment to production @ https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
run: | | |
curl -X POST -H "Authorization: Bearer ${META_WEBHOOK_TOKEN}" \ | |
-H "Content-Type: application/json" \ | |
-d @- https://meta-webhook.infra.rwx.im/trigger <<JSON | |
{ | |
"method": "message", | |
"params": { | |
"network": "${IRC_NETWORK}", | |
"channel": "${IRC_CHANNEL}", | |
"message": "${MESSAGE}" | |
} | |
} | |
JSON | |
deploy: | |
name: Deploy / Production | |
runs-on: ubuntu-latest | |
environment: production | |
needs: | |
- build | |
steps: | |
- name: Clone deployment repository | |
uses: actions/checkout@v4 | |
with: | |
repository: mkroman/k8s-meta-apps | |
ssh-key: ${{ secrets.DEPLOYMENT_PRIVATE_KEY }} | |
- name: Configure git credentials | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Install kustomize | |
env: | |
KUSTOMIZE_VERSION: "v5.3.0" | |
KUSTOMIZE_SHA256SUM: "1a9088a1e20691b531f5e69e8b6b6142bf97dc4a181329c2058d84fc4736eed8" | |
run: | | |
curl -L "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz" -o kustomize.tar.gz | |
tar xvf "kustomize.tar.gz" | |
echo "${KUSTOMIZE_SHA256SUM} kustomize" | sha256sum -c | |
install -m0755 ./kustomize /usr/local/bin/kustomize | |
working-directory: /tmp | |
- name: Update meta image tag | |
env: | |
IMAGE_TAG: sha-${{ github.sha }} | |
run: | | |
kustomize edit set image "meta=ghcr.io/rwx-labs/meta-oss:${IMAGE_TAG}" | |
git add . | |
git commit -m "meta: Update to ${IMAGE_TAG}" | |
git push | |
working-directory: ./meta/overlays/oss |