2023-10-05 02:14:56 +02:00
|
|
|
name: Build and push docker (release)
|
2023-10-03 12:22:31 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
2023-10-05 02:52:37 +02:00
|
|
|
IMAGE_NAME: ibotpeaches/apktool
|
2023-10-03 12:22:31 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_push:
|
|
|
|
name: Build and push
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2023-10-05 02:52:37 +02:00
|
|
|
|
2023-10-03 12:22:31 +02:00
|
|
|
- name: Log in to the Container registry
|
2023-10-09 12:07:24 +02:00
|
|
|
uses: docker/login-action@v3
|
2023-10-03 12:22:31 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2023-10-05 02:52:37 +02:00
|
|
|
|
2023-10-03 12:22:31 +02:00
|
|
|
- name: Get hash
|
|
|
|
id: hash
|
|
|
|
run: echo "APKTOOL_HASH=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
|
2023-10-05 02:52:37 +02:00
|
|
|
|
2023-10-03 12:22:31 +02:00
|
|
|
- name: Get release tag
|
|
|
|
id: tag
|
|
|
|
run: echo "APKTOOL_TAG=$(echo ${GITHUB_REF:-no-tag} |sed 's|refs/tags/||g')" >> $GITHUB_ENV
|
2023-10-05 02:52:37 +02:00
|
|
|
|
2023-10-03 12:22:31 +02:00
|
|
|
- name: Set up Docker Buildx
|
2023-10-09 12:22:37 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-10-05 02:52:37 +02:00
|
|
|
|
2023-10-03 12:22:31 +02:00
|
|
|
- name: Build and push Docker image
|
2023-10-09 11:47:55 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2023-10-03 12:22:31 +02:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64
|
2023-10-05 02:14:56 +02:00
|
|
|
file: ./docker/Dockerfile
|
2023-10-03 12:22:31 +02:00
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.APKTOOL_TAG }}
|
|
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|