-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 2.08 KB
/
main.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
53
54
55
56
57
58
59
60
# This is a basic workflow to help you get started with Actions
name: Build and push to Docker Hub
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: ["*"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
intera/ci-cypress
intera/docker-ci-cypress
# generate Docker tags based on the following events/attributes
tags: |
type=raw,priority=700,value=latest,enable={{ is_default_branch }}
type=ref,event=branch
- name: Log in to Docker Hub
# Uses v2.1.0, sha1 is used for better security
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: |
${{ steps.meta.outputs.tags }}
intera/ci-cypress:local
- name: Verify Cypress
run: |
docker run --rm -v "$(pwd)/verify.sh":/opt/verify.sh intera/ci-cypress:local bash /opt/verify.sh
- name: Push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}