This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.53 KB
/
php-8.1.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
name: Publish PHP 8.1 image
env:
IMAGE_NAME: php
VERSION: "8.1"
on:
push:
branches:
- master
paths:
- php/8.1/**
- .github/workflows/php-8.1.yml
# Jobs should be the same for every workflow in this repository
# They are configured via ENV variables above and should not be altered in other ways!
jobs:
push_github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build ./$IMAGE_NAME/$VERSION/ --tag image
- name: Push image to GitHub registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
push_dockerhub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build ./$IMAGE_NAME/$VERSION/ --tag image
- name: Push image to Docker registry
run: |
echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
IMAGE_ID=getstackhead/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION