update #54369
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: update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0,30 * * * *' | |
jobs: | |
update: | |
name: update | |
runs-on: ubuntu-24.04 | |
outputs: | |
main: ${{ steps.update.outputs.result }} | |
steps: | |
- name: pull repository | |
id: repository | |
uses: actions/checkout@v4 | |
- name: install bun | |
id: bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: 1.2.1 | |
- name: run update script | |
id: update | |
run: | | |
cd .github/scripts/ && bun install && cd ../../ | |
result=$(bun run .github/scripts/update.ts) | |
echo "result=$result" >> $GITHUB_OUTPUT | |
- name: commit the changes | |
id: commit | |
if: steps.update.outputs.result == 'continue' | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add configuration/ | |
if git diff --cached --quiet; then | |
echo "No changes in configuration files, skipping…" | |
else | |
git commit -m "Update configuration files" | |
git push origin master | |
fi | |
deploy: | |
name: ${{ matrix.node }} | |
needs: [update] | |
if: needs.update.outputs.main == 'continue' | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 360 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
node: [12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, latest, lts] | |
steps: | |
- name: pull repository | |
uses: actions/checkout@v4 | |
id: repository | |
- name: setup docker qemu | |
uses: docker/setup-qemu-action@v3 | |
id: qemu | |
- name: setup docker buildx | |
uses: docker/setup-buildx-action@v3 | |
id: buildx | |
- name: install dependencies | |
id: dependencies | |
run: | | |
sudo apt install jq -y | |
- name: update repository | |
id: update-repository | |
run: | | |
git pull origin master | |
- name: install bun | |
id: bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: 1.2.1 | |
- name: build and push the docker container image | |
id: build | |
run: | | |
bun install | |
bun run build.ts ${{ matrix.node }} | |
env: | |
CONTAINER_REGISTRY_TOKEN: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} | |
CONTAINER_REGISTRY_USERNAME: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
QUAY_REGISTRY_TOKEN: ${{ secrets.QUAY_REGISTRY_TOKEN }} | |
QUAY_REGISTRY_USERNAME: ${{ secrets.QUAY_REGISTRY_USERNAME }} | |
notify-ci-node: | |
name: notify-ci-node | |
needs: [deploy] | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: start ci-node workflow | |
id: push-ci-node | |
run: | | |
curl -XPOST -u "${{ secrets.PANASCAIS_CI_NODE_USERNAME}}:${{secrets.PANASCAIS_CI_NODE_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/panascais-docker/ci-node/actions/workflows/main.yml/dispatches --data '{"ref": "master"}'; |