Skip to content

Commit 4e6130e

Browse files
authored
CLOUDP-140751: Update deprecated GitHub actions commands (#723)
1 parent 5343712 commit 4e6130e

14 files changed

+179
-91
lines changed

.github/actions/set-tag/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ if [ -z "${branch_name}" ]; then
1212
fi
1313
branch_name=$(echo "${branch_name}" | awk '{print substr($0, 1, 15)}' | sed 's/\//-/g; s/\./-/g')
1414
tag="${branch_name}-${commit_id}"
15-
echo "::set-output name=tag::$tag"
15+
echo "tag=$tag" >> "$GITHUB_OUTPUT"

.github/workflows/build-test-app.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ jobs:
1616

1717
steps:
1818
- name: Check out code
19-
uses: actions/checkout@v3.0.0
19+
uses: actions/checkout@v3.1.0
2020

21-
- name: Push Image to repo
22-
uses: docker/build-push-action@v1
21+
- name: Login to docker registry
22+
uses: docker/login-action@v2
2323
with:
24+
registry: ${{ env.DOCKER_REGISTRY }}
2425
username: ${{ secrets.DOCKER_USERNAME }}
2526
password: ${{ secrets.DOCKER_PASSWORD }}
26-
repository: ${{ env.DOCKER_REPO }}
27-
registry: ${{ env.DOCKER_REGISTRY }}
28-
path: test/app/
29-
tags: latest
27+
- name: Prepare docker image tag
28+
id: prepare-docker-image-tag
29+
run: |
30+
REPOSITORY=${{ env.DOCKER_REPO }}
31+
TAGS="${REPOSITORY}:latest"
32+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
33+
- name: Push Image to repo
34+
uses: docker/build-push-action@v3
35+
with:
36+
context: test/app
37+
push: true
38+
tags: ${{ steps.prepare-docker-image-tag.outputs.tags }}

.github/workflows/cleanup-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: Cleanup atlas empty projects, and terminate cluster
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v3.0.0
32+
- uses: actions/checkout@v3.1.0
3333

3434
- name: CleanUp Atlas organization
3535
uses: ./.github/actions/cleanup

.github/workflows/deploy.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,31 @@ jobs:
1515
steps:
1616

1717
- name: Check out code
18-
uses: actions/checkout@v3.0.0
18+
uses: actions/checkout@v3.1.0
1919

2020
- name: Prepare tag
2121
id: prepare
2222
uses: ./.github/actions/set-tag
2323

24-
- name: Push Atlas Operator to Registry
25-
uses: docker/build-push-action@v1
24+
- name: Login to docker.io
25+
uses: docker/login-action@v2
2626
with:
27+
registry: ${{ env.DOCKER_REGISTRY }}
2728
username: ${{ secrets.DOCKER_USERNAME }}
2829
password: ${{ secrets.DOCKER_PASSWORD }}
29-
repository: ${{ env.DOCKER_REPO }}
30-
registry: ${{ env.DOCKER_REGISTRY }}
31-
tags: ${{ steps.prepare.outputs.tag }}
30+
- name: Prepare docker image tag
31+
id: prepare-docker-image-tag
32+
run: |
33+
REPOSITORY=${{ env.DOCKER_REPO }}
34+
TAG=${{ steps.prepare.outputs.tag }}
35+
TAGS="${REPOSITORY}:${TAG}"
36+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
37+
- name: Push Atlas Operator to Registry
38+
uses: docker/build-push-action@v3
39+
with:
40+
context: .
41+
push: true
42+
tags: ${{ steps.prepare-docker-image-tag.outputs.tags }}
3243

3344
- name: Deploy Operator to K8s cluster
3445
uses: ./.github/actions/deploy

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: lint
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v3.0.0
18+
- uses: actions/checkout@v3.1.0
1919

2020
- name: Setup Go
2121
uses: actions/setup-go@v3

.github/workflows/openshift-upgrade-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ jobs:
3535
steps:
3636
- if: ${{ inputs.forked == false }}
3737
name: Check out code
38-
uses: actions/checkout@v3.0.0
38+
uses: actions/checkout@v3.1.0
3939
with:
4040
fetch-depth: 0 # required for tags
4141

4242
- if: ${{ inputs.forked == true }}
4343
name: Check out code
44-
uses: actions/checkout@v3.0.0
44+
uses: actions/checkout@v3.1.0
4545
with:
4646
ref: ${{github.event.pull_request.head.sha}}
4747
repository: ${{github.event.pull_request.head.repo.full_name}}

.github/workflows/release-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323

2424
- name: Check out code into the Go module directory
25-
uses: actions/checkout@v3.0.0
25+
uses: actions/checkout@v3.1.0
2626
with:
2727
fetch-depth: 0 #required for tags
2828

.github/workflows/release-certify.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
QUAY_ROBOT_NAME: mongodb+mongodb_atlas_kubernetes
2727
steps:
2828
- name: Check out code into the Go module directory
29-
uses: actions/checkout@v3.0.0
29+
uses: actions/checkout@v3.1.0
3030
with:
3131
fetch-depth: 0 #needs for tags
3232

@@ -36,7 +36,7 @@ jobs:
3636
chmod +x ./preflight && sudo mv ./preflight /usr/local/bin/preflight
3737
3838
- name: Clone certified-operators repo
39-
uses: actions/checkout@master
39+
uses: actions/checkout@v3.1.0
4040
with:
4141
repository: redhat-openshift-ecosystem/certified-operators
4242
path: ../certified-operators

.github/workflows/release-post-install-hook.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ jobs:
1717
QUAY_RELEASE_REGISTRY: quay.io
1818
steps:
1919
- name: Check out code into the Go module directory
20-
uses: actions/checkout@v3.0.0
20+
uses: actions/checkout@v3.1.0
2121
with:
22+
submodules: true
2223
fetch-depth: 0
2324

2425
- name: Install axios
@@ -46,12 +47,23 @@ jobs:
4647
echo "Release ${version} already exists"
4748
exit 1
4849
49-
- name: Push Post Install Hook To Registry
50-
uses: docker/build-push-action@v1
50+
- name: Login to Quay registry
51+
uses: docker/login-action@v2
5152
with:
53+
registry: ${{ env.QUAY_RELEASE_REGISTRY }}
5254
username: ${{ env.QUAY_ROBOT_NAME }}
5355
password: ${{ secrets.QUAY_PASSWORD }}
54-
repository: ${{ env.QUAY_RELEASE_REPO }}
55-
registry: ${{ env.QUAY_RELEASE_REGISTRY }}
56-
tags: ${{ github.event.inputs.version }}
56+
- name: Prepare docker image tag
57+
id: prepare-quay-image-tag
58+
run: |
59+
REPOSITORY=${{ env.QUAY_RELEASE_REPO }}
60+
TAG=${{ github.event.inputs.version }}
61+
TAGS="${REPOSITORY}:${TAG}"
62+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
63+
- name: Push Post Install Hook To Registry
64+
uses: docker/build-push-action@v3
65+
with:
66+
push: true
67+
context: .
68+
tags: ${{ steps.prepare-quay-image-tag.outputs.tags }}
5769
file: Dockerfile.post-install

.github/workflows/release-post-merge.yml

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,37 +42,60 @@ jobs:
4242
4343
echo "VERSION:$version"
4444
tag="v${version}"
45-
echo "::set-output name=version::$version"
46-
echo "::set-output name=tag::$tag"
45+
echo "version=$version" >> $GITHUB_OUTPUT
46+
echo "tag=$tag" >> $GITHUB_OUTPUT
4747
4848
- name: Check out code into the Go module directory
49-
uses: actions/checkout@v3.0.0
49+
uses: actions/checkout@v3.1.0
5050
with:
51+
submodules: true
5152
fetch-depth: 0 #needs for tags
5253

5354
- name: Create configuration package
5455
run: |
5556
set -x
5657
tar czvf atlas-operator-all-in-one-${{ steps.tag.outputs.version }}.tar.gz -C deploy all-in-one.yaml
5758
58-
- name: Push Atlas Operator to Registry
59-
uses: docker/build-push-action@v1
59+
- name: Login to docker registry
60+
uses: docker/login-action@v2
6061
with:
62+
registry: ${{ env.DOCKER_REGISTRY }}
6163
username: ${{ secrets.DOCKER_USERNAME }}
6264
password: ${{ secrets.DOCKER_PASSWORD }}
63-
repository: ${{ env.DOCKER_RELEASE_REPO }}
64-
registry: ${{ env.DOCKER_REGISTRY }}
65-
tags: ${{ steps.tag.outputs.version }}
65+
- name: Prepare docker image tag
66+
id: prepare-docker-image-tag
67+
run: |
68+
REPOSITORY=${{ env.DOCKER_RELEASE_REPO }}
69+
TAG=${{ steps.tag.outputs.version }}
70+
TAGS="${REPOSITORY}:${TAG}"
71+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
72+
- name: Push Atlas Operator to Registry
73+
uses: docker/build-push-action@v3
74+
with:
75+
context: .
76+
push: true
77+
tags: ${{ steps.prepare-docker-image-tag.outputs.tags }}
6678
build_args: VERSION=${{ steps.tag.outputs.tag }}
6779

68-
- name: Push Atlas Operator to Quay Registry
69-
uses: docker/build-push-action@v1
80+
- name: Login to Quay registry
81+
uses: docker/login-action@v2
7082
with:
83+
registry: ${{ env.QUAY_RELEASE_REGISTRY }}
7184
username: ${{ env.QUAY_ROBOT_NAME }}
7285
password: ${{ secrets.QUAY_PASSWORD }}
73-
repository: ${{ env.QUAY_OPERATOR_REPO }}
74-
registry: ${{ env.QUAY_RELEASE_REGISTRY }}
75-
tags: ${{ steps.tag.outputs.version }}
86+
- name: Prepare docker Quay image tag
87+
id: prepare-quay-image-tag
88+
run: |
89+
REPOSITORY=${{ env.QUAY_OPERATOR_REPO }}
90+
TAG=${{ steps.tag.outputs.version }}
91+
TAGS="${REPOSITORY}:${TAG}"
92+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
93+
- name: Push Atlas Operator to Quay Registry
94+
uses: docker/build-push-action@v3
95+
with:
96+
context: .
97+
push: true
98+
tags: ${{ steps.prepare-quay-image-tag.outputs.tags }}
7699
build_args: VERSION=${{ steps.tag.outputs.tag }}
77100

78101
- name: Now Prepare RedHadConnect image
@@ -82,14 +105,26 @@ jobs:
82105
VERSION: ${{ env.VERSION }}
83106
ENV: prod
84107

85-
- name: Push Atlas Operator to RedHat Connect
86-
uses: docker/build-push-action@v1
108+
109+
- name: Login to RedHat registry
110+
uses: docker/login-action@v2
87111
with:
112+
registry: ${{ env.REDHAT_SCAN_RELEASE_REGISTRY }}
88113
username: unused
89114
password: ${{ secrets.REDHAT_REGISTRY_PASSWORD }}
90-
repository: ${{ env.REDHAT_SCAN_OPERATOR_REPO }}
91-
registry: ${{ env.REDHAT_SCAN_RELEASE_REGISTRY }}
92-
tags: ${{ steps.tag.outputs.version }}
115+
- name: Prepare docker Quay image tag
116+
id: prepare-redhat-image-tag
117+
run: |
118+
REPOSITORY=${{ env.REDHAT_SCAN_OPERATOR_REPO }}
119+
TAG=${{ steps.tag.outputs.version }}
120+
TAGS="${REPOSITORY}:${TAG}"
121+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
122+
- name: Push Atlas Operator to RedHat Connect
123+
uses: docker/build-push-action@v3
124+
with:
125+
context: .
126+
push: true
127+
tags: ${{ steps.prepare-redhat-image-tag.outputs.tags }}
93128
labels: version=${{ steps.tag.outputs.version }}
94129
build_args: VERSION=${{ steps.tag.outputs.tag }}
95130

@@ -116,4 +151,4 @@ jobs:
116151
asset_name: atlas-operator-all-in-one-${{ steps.tag.outputs.version }}.tar.gz
117152
asset_content_type: application/tgz
118153

119-
# TODO RedHad autopublish does not work. need to push bundles manually for now
154+
# TODO RedHad autopublish does not work. need to push bundles manually for now

0 commit comments

Comments
 (0)