Build DigitalOcean Image #13
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: Build DigitalOcean Image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'App Version' | |
| required: true | |
| type: string | |
| jobs: | |
| build-do-image: | |
| name: Build DigitalOcean Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Packer | |
| run: | | |
| wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg | |
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list | |
| sudo apt update && sudo apt install packer | |
| - name: Build Droplet Image | |
| env: | |
| DIGITALOCEAN_API_TOKEN: ${{ secrets.DO_TOKEN }} | |
| WIKI_APP_VERSION: ${{ github.event.inputs.version }} | |
| working-directory: dev/packer | |
| run: | | |
| packer plugins install github.com/digitalocean/digitalocean | |
| packer build digitalocean.json |