forked from oracle/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.58 KB
/
build-and-push-nosql-image.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: Build and publish NoSQL container image to GitHub Container Registry
on:
push:
branches:
- main
paths:
- 'NoSQL/ce/*'
- '.github/workflows/build-and-push-nosql-image.yml'
workflow_dispatch:
env:
IMAGE_NAME: nosql
TAG: ce
jobs:
push:
name: Build and push NoSQL ce image
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin
- name: Repository owner needs to be lowercase
id: repo-owner
run: |
REPO_OWNER=${{ github.repository_owner }}
echo "::set-output name=repo-owner::${REPO_OWNER,,}"
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m')"
- name: Build NoSQL ce image
run: |
cd NoSQL/ce
docker build --tag ghcr.io/${{ steps.repo-owner.outputs.repo-owner }}/$IMAGE_NAME:$TAG .
docker tag ghcr.io/${{ steps.repo-owner.outputs.repo-owner }}/$IMAGE_NAME:$TAG ghcr.io/${{ steps.repo-owner.outputs.repo-owner }}/$IMAGE_NAME:latest-ce
env:
TAG: ${{ steps.date.outputs.date }}-ce
- name: Push image to GitHub Container Registry
run: |
docker push ghcr.io/${{ steps.repo-owner.outputs.repo-owner }}/$IMAGE_NAME:$TAG
docker push ghcr.io/${{ steps.repo-owner.outputs.repo-owner }}/$IMAGE_NAME:latest-ce
env:
TAG: ${{ steps.date.outputs.date }}-ce