Skip to content

curl-impersonate: A special build of curl that can impersonate Chrome & Firefox

Add action to push alpine images to Docker Hub

lwthiker21af00356e93
diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml
new file mode 100644
index 0000000..1087cbc
--- /dev/null
+++ b/.github/workflows/publish-docker-image.yml
@@ -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 }}