Bump cryptography from 40.0.2 to 42.0.0 in /relay #190
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Magic Wormhole Images | |
on: | |
push: | |
branches: [ "main" ] | |
tags: [ "*" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install docker support | |
id: install_docker | |
run: | | |
sudo apt install --quiet docker-compose | |
docker run hello-world | |
- name: Cache images | |
uses: ScribeMD/docker-cache@0.3.3 | |
with: | |
key: | | |
docker-${{ runner.os }}-${{ hashFiles( | |
'**/docker-compose*.yml', | |
'**/*Dockerfile*', | |
'**/requirements.*' | |
) }} | |
- name: Build images | |
id: build_images | |
run: | | |
# Only if not just restored from the cache | |
if [ $(docker images --quiet leastauthority/magic-wormhole*:latest | wc -l) -lt 3 ]; then | |
docker-compose -f docker-compose-back.yml build --progress=plain | |
docker-compose -f docker-compose-front.yml build --progress=plain | |
fi | |
- name: Test images | |
id: test_images | |
env: | |
MW_MAILBOX_PORT: 4000 | |
MW_RELAY_PORT: 4001 | |
MW_RELAY_WS_PORT: 4200 | |
run: | | |
# Start the back-end with the current user ID | |
echo "MW_MAILBOX_UID=$(id -u)" >> .env | |
echo "MW_RELAY_UID=$(id -u)" >> .env | |
mkdir mailbox_database relay_database | |
docker-compose -f docker-compose-back.yml up --detach | |
# Wait for the services | |
for try in {1..3}; do | |
{ nc -w 3 127.0.0.1 ${MW_MAILBOX_PORT} > /dev/null 2>&1 && \ | |
nc -w 3 127.0.0.1 ${MW_RELAY_PORT} > /dev/null 2>&1 && \ | |
nc -w 3 127.0.0.1 ${MW_RELAY_WS_PORT} > /dev/null 2>&1; \ | |
} && break || { sleep 1; } | |
if [ $try = 3 ]; then | |
echo ":x: Back-end services failed to start" >> $GITHUB_STEP_SUMMARY; | |
exit 1 | |
fi | |
done | |
docker-compose -f docker-compose-back.yml ps | |
docker-compose -f docker-compose-front.yml up --abort-on-container-exit || \ | |
{ docker-compose -f docker-compose-back.yml logs; | |
RET=1; } | |
docker-compose -f docker-compose-back.yml down | |
exit ${RET:-0} | |
- name: Determine target tag | |
id: target | |
run: | | |
echo "github.ref: ${{ github.ref }}" | |
echo "github.ref_type: ${{ github.ref_type }}" | |
if [ ${{ github.ref_type }} == 'branch' ]; then | |
echo "target_tag=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
else | |
echo "target_tag=$(git describe --tags --always)" >> $GITHUB_ENV | |
fi | |
cat $GITHUB_ENV | |
- name: Tag images | |
id: tag_images | |
run: | | |
for image in magic-wormhole-mailbox magic-wormhole-relay magic-wormhole; do | |
docker tag leastauthority/${image}:latest leastauthority/${image}:${{ env.target_tag }} | |
done | |
- name: List images | |
id: list_images | |
run: | | |
docker images leastauthority/magic-wormhole*:* | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' | |
- name: Push to docker hub | |
run: | | |
for image in magic-wormhole-mailbox magic-wormhole-relay magic-wormhole; do | |
docker push leastauthority/${image}:${{ env.target_tag }} | |
done | |
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' | |
- name: Push to docker hub latest | |
run: | | |
for image in magic-wormhole-mailbox magic-wormhole-relay magic-wormhole; do | |
docker push leastauthority/${image}:latest | |
done | |
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' |