-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (46 loc) · 1.51 KB
/
nextcloud.yaml
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
name: Push nextcloud Image
on:
push:
tags:
- v*
branches:
- master
env:
IMAGE_NAME: nextcloud
jobs:
image:
name: Build nextcloud Image
runs-on: ubuntu-latest
steps:
- name: Set IMAGE_TAG env (on push to master branch)
run: echo "IMAGE_TAG=latest" >> $GITHUB_ENV
if: github.ref == 'refs/heads/master'
- name: Set IMAGE_TAG env (on tag)
run: echo "IMAGE_TAG=${GITHUB_REF:11}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags')
- uses: actions/checkout@v2
- name: Set PHP_VERSION env
run: echo "PHP_VERSION=$(cat ./nextcloud/php_version)" >> $GITHUB_ENV
- name: Set NEXTCLOUD_VERSION env
run: echo "NEXTCLOUD_VERSION=$(cat ./nextcloud/nextcloud_version)" >> $GITHUB_ENV
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: traptitech
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./nextcloud
push: true
platforms: linux/amd64
build-args: |
NEXTCLOUD_VERSION=${{ env.NEXTCLOUD_VERSION }}-fpm
PHP_VERSION=${{ env.PHP_VERSION }}
tags: |
ghcr.io/traptitech/${{ env.IMAGE_NAME }}:latest
ghcr.io/traptitech/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}