Repository navigation
Cloud images PREMIUM #64
Workflow file for this run
This file contains hidden or 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
| # -------------------------------------------------------------------------------------------- | |
| # This file is generated. Do not edit manually | |
| # -------------------------------------------------------------------------------------------- | |
| name: Cloud images PREMIUM | |
| 'on': | |
| push: | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| - v[0-9]+.[0-9]+.[0-9]+-packer-beta.[0-9]+ | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-22.04 | |
| steps: | |
| - name: Context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 22.x | |
| - name: Install jq | |
| run: | | |
| sudo apt-get install jq -y | |
| - name: Setup `packer` | |
| uses: hashicorp/setup-packer@main | |
| with: | |
| version: latest | |
| - name: Checkout dbgate/dbgate-pro | |
| uses: actions/checkout@v2 | |
| with: | |
| repository: dbgate/dbgate-pro | |
| token: ${{ secrets.GH_TOKEN }} | |
| path: dbgate-pro | |
| ref: 87c3efdaf83786abee4366dee2c58fea355edc4c | |
| - name: Merge dbgate/dbgate-pro | |
| run: | | |
| mkdir ../dbgate-pro | |
| mv dbgate-pro/* ../dbgate-pro/ | |
| cd .. | |
| mkdir dbgate-merged | |
| cd dbgate-pro | |
| cd sync | |
| yarn | |
| node sync.js --nowatch | |
| cd .. | |
| - name: adjustPackageJson | |
| run: | | |
| cd .. | |
| cd dbgate-merged | |
| node adjustPackageJson --premium | |
| - name: yarn install | |
| run: | | |
| cd .. | |
| cd dbgate-merged | |
| yarn install | |
| - name: setCurrentVersion | |
| run: | | |
| cd .. | |
| cd dbgate-merged | |
| yarn setCurrentVersion | |
| - name: Prepare packer build | |
| run: | | |
| cd .. | |
| cd dbgate-merged | |
| yarn run prepare:packer | |
| cd packer | |
| zip -r cloud-build.zip build | |
| - name: Copy artifacts | |
| run: | | |
| mkdir artifacts | |
| cp ../dbgate-merged/packer/cloud-build.zip artifacts/cloud-build.zip || true | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }} | |
| path: artifacts | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: artifacts/** | |
| prerelease: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run `packer init` for AWS | |
| run: | | |
| cd ../dbgate-merged/packer | |
| packer init ./aws-ubuntu.pkr.hcl | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
| AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
| AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} | |
| - name: Run `packer build` for AWS | |
| run: | | |
| cd ../dbgate-merged/packer | |
| packer build ./aws-ubuntu.pkr.hcl | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
| AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
| AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} | |
| - name: Delete old AMIs (AWS) | |
| run: | | |
| cd ../dbgate-merged/packer | |
| chmod +x delete-old-amis.sh | |
| ./delete-old-amis.sh | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
| AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
| AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} |