-
Notifications
You must be signed in to change notification settings - Fork 7
37 lines (37 loc) · 1.13 KB
/
publish-scraper.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Create a new release when a tag is pushed, create a docker image and push it to docker hub
name: Publish Scraper
on:
push:
tags:
- 'v*'
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_CREATION_TOKEN }}
with:
tag_name: scraper-${{ github.ref }}
release_name: Scraper ${{ github.ref }}
draft: false
prerelease: false
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: ./
file: ./scraper/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/statusphere-scraper:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/statusphere-scraper:latest