Docker Image Builder #18
This file contains 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: Docker Image Builder | |
on: | |
# Allow manual dispatch | |
workflow_dispatch: | |
# Run only manually for now | |
# release: | |
# types: [released] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get tags | |
run: git fetch --tags origin | |
- name: Get git tag version | |
run: echo git_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) >> $GITHUB_ENV | |
- name: Running for git tag | |
run: echo ${{ env.git_tag }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Create builder | |
run: docker buildx create --name senselink-builder | |
- name: Use senselink-builder | |
run: docker buildx use senselink-builder | |
- run: docker buildx inspect --bootstrap | |
- name: Log in to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: theta142 | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Build SenseLink for various platforms | |
run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t theta142/senselink:${{ env.git_tag }} --push . | |
- name: Push for tag latest only if not beta or alpha tagged | |
if: ${{ !contains(env.git_tag, 'beta') && !contains(env.git_tag, 'alpha') }} | |
run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t theta142/senselink:latest --push . |