Skip to content

Commit 1a931fc

Browse files
committed
ci: build/push docker image on new tags
1 parent a3c1db8 commit 1a931fc

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Push WordPress Image
2+
3+
on:
4+
pull_request:
5+
# workflow_dispatch:
6+
# push:
7+
# tags:
8+
# - "v*"
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
container: python:3.9-slim
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Needed to get tag information
20+
21+
- name: Get the version tag
22+
id: get-tag
23+
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
24+
25+
- name: Install Tutor
26+
run: pip install -U tutor
27+
28+
- name: Install tutor-plugin-wordpress
29+
run: |
30+
echo tag is $TAG
31+
# pip install git+https://github.com/codewithemad/tutor-plugin-wordpress@$TAG
32+
pip install git+https://github.com/codewithemad/tutor-plugin-wordpress@1.2.0
33+
34+
- name: Initialize Tutor
35+
run: |
36+
tutor config save
37+
tutor plugins enable wordpress
38+
39+
- name: Login to Docker Hub
40+
uses: docker/login-action@v3
41+
with:
42+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
43+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
44+
45+
- name: Build WordPress image
46+
run: tutor images build wordpress
47+
48+
- name: Push WordPress image
49+
run: tutor images push wordpress

0 commit comments

Comments
 (0)