Commit e59b4496 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

ci: Docker login on push (#3559)

* ci: Docker login on push

Increases the reliability of Docker publish jobs by logging in to Docker Hub first. The secret used is read-only, and scoped to public repositories only.

Note that the `l1ops` Hive test will continue to fail until https://github.com/ethereum-optimism/hive/pull/43 is merged.

* remove repo

* specify nameservers

* Update config.yml
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 53fbf917
......@@ -85,6 +85,13 @@ jobs:
image: ubuntu-2204:2022.07.1
resource_class: xlarge
steps:
# Below is CircleCI recommended way of specifying nameservers on an Ubuntu box:
# https://support.circleci.com/hc/en-us/articles/7323511028251-How-to-set-custom-DNS-on-Ubuntu-based-images-using-netplan
- run: sudo sed -i '13 i \ \ \ \ \ \ \ \ \ \ \ \ nameservers:' /etc/netplan/50-cloud-init.yaml
- run: sudo sed -i '14 i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addresses:' /etc/netplan/50-cloud-init.yaml
- run: sudo sed -i "s/addresses:/ addresses":" [8.8.8.8, 8.8.4.4] /g" /etc/netplan/50-cloud-init.yaml
- run: cat /etc/netplan/50-cloud-init.yaml
- run: sudo netplan apply
- checkout
- when:
condition: <<parameters.target>>
......@@ -92,6 +99,7 @@ jobs:
- run:
name: Build with context
command: |
echo "$DOCKER_HUB_READ_ONLY_TOKEN" | docker login -u "$DOCKER_HUB_READ_ONLY_USER" --password-stdin
docker build \
$(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \
-f <<parameters.docker_file>> \
......@@ -103,6 +111,7 @@ jobs:
- run:
name: Build
command: |
echo "$DOCKER_HUB_READ_ONLY_TOKEN" | docker login -u "$DOCKER_HUB_READ_ONLY_USER" --password-stdin
docker build \
$(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \
-f <<parameters.docker_file>> \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment