Create release #16
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
| name: Create release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| TARGET_HOST_POOL: | |
| description: 'AWX host pool' | |
| required: false | |
| type: choice | |
| default: 'testnet' | |
| options: | |
| - 'testnet' | |
| - 'mainnet' | |
| jobs: | |
| CI: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5.0.0 | |
| - name: Go Setup | |
| uses: ./.github/actions/go-setup-action | |
| with: | |
| go-version: ${{ vars.GO_VERSION }} | |
| go-private: ${{ vars.GO_PRIVATE_REPO }} | |
| git-user: ${{ secrets.GIT_USER }} | |
| git-pass: ${{ secrets.GIT_PASS }} | |
| - name: Docker Login | |
| uses: docker/login-action@v3.5.0 | |
| with: | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
| - name: Docker image build and push | |
| uses: docker/build-push-action@v6.18.0 | |
| with: | |
| context: . | |
| file: Dockerfile.golang | |
| push: true | |
| tags: | | |
| kleverapp/klv-bridge:${{ github.sha }} | |
| kleverapp/klv-bridge:latest | |
| CD: | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.ref_name }} | |
| needs: | |
| - CI | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5.0.0 | |
| - name: Twingate Setup | |
| uses: twingate/github-action@V1.1 | |
| with: | |
| service-key: ${{ secrets.TWINGATE_SERVICE_ACCOUNT }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install AWX CLI | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install awxkit | |
| - name: Launch template on AWX | |
| run: | | |
| export TOWER_HOST="${{ vars.AWX_HOST }}" | |
| export TOWER_USERNAME="${{ vars.AWX_USER }}" | |
| export TOWER_PASSWORD="${{ secrets.AWX_PASS }}" | |
| LOGIN_OUTPUT=$(awx login) | |
| awx job_templates launch "${{ vars.AWX_TEMPLATE_NAME }}" --extra_vars '{"vm_name":"${{ vars.ENV_NETWORK || inputs.TARGET_HOST_POOL }}","docker_image_tag":"kleverapp/klv-bridge:${{ github.sha }}"}' --job_tags update |