Add action to push alpine images to Docker Hub

Add a GitHub action to push alpine images with curl-impersonate to
Docker Hub whenever a new release tag is created.
This commit is contained in:
lwthiker
2022-03-10 12:22:27 +02:00
parent eaeb619fa7
commit 21af00356e

View File

@@ -0,0 +1,42 @@
# Build an Alpine Linux image containing curl-impersonate and push to
# Docker hub.
name: Publish Docker image
on:
push:
tags:
- 'v*'
jobs:
push-docker-image:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta_chrome
uses: docker/metadata-action@v3
with:
images: lwthiker/curl-impersonate
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
flavor: |
suffix=-chrome-alpine3.15
- name: Build and push the Chrome version of curl-impersonate
uses: docker/build-push-action@v2
with:
push: true
context: chrome/
file: chrome/Dockerfile.alpine
tags: ${{ steps.meta_chrome.outputs.tags }}
labels: ${{ steps.meta_chrome.outputs.labels }}