|
1 | 1 | name: Build and Deploy |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +on: [push, pull_request, workflow_dispatch] |
4 | 4 |
|
5 | 5 | jobs: |
6 | 6 | build: |
7 | | - runs-on: ubuntu-latest |
| 7 | + runs-on: ubuntu-24.04-arm |
8 | 8 | steps: |
9 | 9 | - uses: actions/checkout@v4 |
10 | | - |
11 | | - - uses: docker/setup-buildx-action@v3 |
12 | | - - uses: docker/build-push-action@v5 |
13 | | - with: |
14 | | - context: . |
15 | | - cache-from: type=gha |
16 | | - cache-to: type=gha,mode=max |
17 | | - load: true |
18 | | - tags: qcext-server:latest |
19 | 10 |
|
20 | | - - name: Save Docker image |
21 | | - if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' |
22 | | - run: docker save -o qcext-server.tar qcext-server |
23 | | - |
24 | | - - name: Compress Docker image |
25 | | - if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' |
26 | | - run: bzip2 -z qcext-server.tar |
| 11 | + - uses: ilyvion-contrib/container-ci-build@main |
| 12 | + with: |
| 13 | + image: questionablextensions |
27 | 14 |
|
28 | 15 | - name: Upload artifact |
29 | 16 | if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' |
30 | | - uses: actions/upload-artifact@v3 |
| 17 | + uses: actions/upload-artifact@v4 |
31 | 18 | with: |
32 | | - name: qcext-server-tar-bz2 |
33 | | - path: | |
34 | | - qcext-server.tar.bz2 |
35 | | - docker-compose.yml |
36 | | - deploy.sh |
| 19 | + name: questionablextensions-tar |
| 20 | + path: questionablextensions.tar |
37 | 21 |
|
38 | 22 | deploy: |
39 | 23 | runs-on: ubuntu-latest |
40 | 24 | needs: build |
41 | 25 | if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' |
42 | 26 | steps: |
43 | 27 | - name: Download artifact |
44 | | - uses: actions/download-artifact@v3 |
| 28 | + uses: actions/download-artifact@v4 |
45 | 29 | with: |
46 | | - name: qcext-server-tar-bz2 |
47 | | - |
48 | | - - name: Deploy |
49 | | - run: docker-compose run deploy |
50 | | - env: |
51 | | - DEPLOY_KEY: ${{ secrets.deploy_key }} |
52 | | - DEPLOY_TARGET: ${{ secrets.deploy_target }} |
53 | | - DEPLOY_USER: ${{ secrets.deploy_user }} |
| 30 | + name: questionablextensions-tar |
54 | 31 |
|
55 | | - cleanup_job: |
56 | | - needs: [deploy] |
57 | | - runs-on: ubuntu-latest |
58 | | - steps: |
59 | | - - name: Delete artifacts |
60 | | - env: |
61 | | - FOR_WEBHOOKS_SECRET: ${{ secrets.FOR_WEBHOOKS_SECRET }} |
62 | | - run: | |
63 | | - echo "::add-mask::$FOR_WEBHOOKS_SECRET" |
64 | | - curl --verbose --fail --show-error --location --request POST "https://api.github.com/repos/$GITHUB_REPOSITORY/dispatches" --header "Authorization: token $FOR_WEBHOOKS_SECRET" --header 'Content-Type: application/json' --header 'Accept: application/vnd.github.everest-preview+json' --data-raw "{ \"event_type\": \"delete_all_artifacts\", \"client_payload\": {\"parent_runid\": \"$GITHUB_RUN_ID\", \"parent_repo\": \"$GITHUB_REPOSITORY\"} }" |
| 32 | + - uses: ilyvion-contrib/container-ci-deploy@main |
| 33 | + with: |
| 34 | + ssh_known_hosts: ${{ secrets.deploy_known_hosts }} |
| 35 | + ssh_private_key: ${{ secrets.deploy_key }} |
| 36 | + ssh_user: ${{ secrets.deploy_user }} |
| 37 | + ssh_host: ${{ secrets.deploy_target }} |
| 38 | + ssh_port: ${{ secrets.deploy_port }} |
| 39 | + image: questionablextensions |
0 commit comments