forked from garris/BackstopJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
40 lines (36 loc) · 1.18 KB
/
action.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
name: "Pull & Prepare Docker Workflow"
description: "Sets name and tag, logs in to GHCR, and pulls Docker image."
inputs:
REGISTRY:
description: "GitHub Registry"
required: true
ACTOR:
description: "GitHub Username"
required: true
GITHUB_TOKEN:
description: "GitHub Token"
required: true
runs:
using: "composite"
steps:
- name: Set Name and Tag Vars
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
env:
name: "${{ env.BRANCH_NAME }}"
run: |
echo "IMAGE_NAME_LC=${IMAGE_NAME,,}" >>${GITHUB_ENV}
echo "TAG=${name/\//-}" >> $GITHUB_ENV
echo "PV=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
echo "PLAYWRIGHT_VERSION=$(cat package.json | jq -r '.dependencies.playwright')" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ inputs.REGISTRY }}
username: ${{ inputs.ACTOR }}
password: ${{ inputs.GITHUB_TOKEN }}
- name: Pull Image
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
docker pull $REGISTRY/$IMAGE_NAME_LC:$TAG