-
Notifications
You must be signed in to change notification settings - Fork 15
56 lines (48 loc) · 1.85 KB
/
build_web_wiki.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_web_wiki
on:
push:
branches:
- main
paths:
- "web/wiki/**"
jobs:
build_web_wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Grab version
id: version
run: echo "::set-output name=version::$(jq -r '.version' web/wiki/package.json)"
- 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: web/wiki
push: true
tags: itacademybcn/ita-wiki-web:v${{ steps.version.outputs.version }}
- name: Update version
run: |
git config --global user.name "ITA Wiki bot"
git config --global user.email "bot@itawiki.com"
version=$(grep version: ./config/dev/web_wiki.yml | awk '{print $2}')
sed -i "s/version: $version/version: ${{ steps.version.outputs.version }}/" ./config/dev/web_wiki.yml
git add ./config/dev/web_wiki.yml
git commit -m "Bump web_wiki image to v${{ steps.version.outputs.version }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: "Bump web_wiki image version to v${{ steps.version.outputs.version }}"
commit-message: "Bump web_wiki image version to v${{ steps.version.outputs.version }}"
branch: "bump-web_wiki-to-v${{ steps.version.outputs.version }}"
delete-branch: true
token: ${{ secrets.GITHUB_TOKEN }}
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
assignees: ${{ github.actor }}