-
Notifications
You must be signed in to change notification settings - Fork 1.3k
56 lines (46 loc) · 1.42 KB
/
docker.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build Docker Images
on:
push:
branches:
- master
release:
types: [published]
schedule:
- cron: "0 7 * * *"
jobs:
images:
runs-on: ubuntu-latest
steps:
- name: checkout sources
uses: actions/checkout@v4
- name: Set tag to latest
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'schedule'
run: |
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
- name: Set tag to release name
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
run: |
echo "DOCKER_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Check if DOCKER_TAG is set
if: env.DOCKER_TAG == ''
run: |
echo DOCKER_TAG is not set!
exit 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: wpscanteam/wpscan:${{ env.DOCKER_TAG }}