-
-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (45 loc) · 1.95 KB
/
build.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
name: build
on: [push]
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest, self-hosted
env:
DOCKER_REGISTRY: docker.io
ORGANISATION_NAME: aemdesign
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: set envirnment variables
id: config
run: |
source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_get_config.sh)
source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_get_version.sh)
- name: build and test docker image
run: |
docker build --pull -t $IMAGE:$GIT_BRANCH .
source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_container_verify.sh)
(cd test && bash ./run_tests.sh "$IMAGE:$GIT_BRANCH")
docker images
- name: login to docker registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${DOCKER_REGISTRY} -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: push image version
run: |
docker push $IMAGE:$GIT_BRANCH
- name: push latest image on master
if: github.ref == 'refs/heads/master'
run: |
docker tag $IMAGE:$GIT_BRANCH $IMAGE:latest
docker push $IMAGE:latest
- name: update registry description with readme on master
if: github.ref == 'refs/heads/master'
run: |
docker run --rm -v $(pwd):/data/ aemdesign/dockerhub-description "$DOCKER_USERNAME" "$DOCKER_PASSWORD" "$IMAGE"
- uses: meeDamian/[email protected]
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.GITHUB_TAG }}
name: ${{ env.GITHUB_TAG }}
body: ${{ env.GIT_RELEASE_NOTES }}