-
Notifications
You must be signed in to change notification settings - Fork 56
56 lines (52 loc) · 1.6 KB
/
docker-release.yml
File metadata and controls
56 lines (52 loc) · 1.6 KB
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 and Push emoncms legacy Docker Image
on:
workflow_dispatch:
inputs:
php_version:
description: 'php_version'
required: true
type: string
default: '8.2.27'
emoncms_src:
description: 'emoncms_src'
required: true
type: string
default: 'emoncms/emoncms'
branch:
description: 'branch'
required: true
type: string
default: 'stable'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Checkout the repository code
- name: Checkout code
uses: actions/checkout@v4
# Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- id: emoncms_version
name: get emoncms version
run: |
wget https://raw.githubusercontent.com/${{ inputs.emoncms_src }}/${{ inputs.branch }}/version.json
version=$(cat version.json | jq --raw-output '.version')
echo $version
echo "version=$version" >> "$GITHUB_OUTPUT"
# Build and push Docker image
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./web
build-args: |
"BUILD_FROM=php:${{ inputs.php_version }}-apache"
"EMONCMS_SRC=https://github.com/${{ inputs.emoncms_src }}"
"BRANCH=${{ inputs.branch }}"
push: true
tags: |
openenergymonitor/emoncms:latest
openenergymonitor/emoncms:${{ steps.emoncms_version.outputs.version }}