Skip to content

Commit 5e0ceaf

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

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/build.yml

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

0 commit comments

Comments
 (0)