|
| 1 | +name: Create docker images (manual) |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + type: string |
| 8 | + description: Version |
| 9 | + required: true |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: Build, push, and deploy |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + db-type: [postgresql] |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v3 |
| 22 | + |
| 23 | + - name: Extract version parts from input |
| 24 | + id: extract_version |
| 25 | + run: | |
| 26 | + echo "version=$(echo ${{ github.event.inputs.version }})" >> $GITHUB_ENV |
| 27 | + echo "major=$(echo ${{ github.event.inputs.version }} | cut -d. -f1)" >> $GITHUB_ENV |
| 28 | + echo "minor=$(echo ${{ github.event.inputs.version }} | cut -d. -f2)" >> $GITHUB_ENV |
| 29 | +
|
| 30 | + - name: Generate tags |
| 31 | + id: generate_tags |
| 32 | + run: | |
| 33 | + echo "tag_major=$(echo ${{ matrix.db-type }}-${{ env.major }})" >> $GITHUB_ENV |
| 34 | + echo "tag_minor=$(echo ${{ matrix.db-type }}-${{ env.major }}.${{ env.minor }})" >> $GITHUB_ENV |
| 35 | + echo "tag_patch=$(echo ${{ matrix.db-type }}-${{ env.version }})" >> $GITHUB_ENV |
| 36 | + echo "tag_latest=$(echo ${{ matrix.db-type }}-latest)" >> $GITHUB_ENV |
| 37 | +
|
| 38 | + - uses: mr-smithers-excellent/docker-build-push@v6 |
| 39 | + name: Build & push Docker image to ghcr.io for ${{ matrix.db-type }} |
| 40 | + with: |
| 41 | + image: umami |
| 42 | + tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }} |
| 43 | + buildArgs: DATABASE_TYPE=${{ matrix.db-type }} |
| 44 | + registry: ghcr.io |
| 45 | + multiPlatform: true |
| 46 | + platform: linux/amd64,linux/arm64 |
| 47 | + username: ${{ github.actor }} |
| 48 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + |
| 50 | + - uses: mr-smithers-excellent/docker-build-push@v6 |
| 51 | + name: Build & push Docker image to docker.io for ${{ matrix.db-type }} |
| 52 | + with: |
| 53 | + image: umamisoftware/umami |
| 54 | + tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }} |
| 55 | + buildArgs: DATABASE_TYPE=${{ matrix.db-type }} |
| 56 | + registry: docker.io |
| 57 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 58 | + password: ${{ secrets.DOCKER_PASSWORD }} |
0 commit comments