Skip to content

Bump golang.org/x/crypto from 0.37.0 to 0.45.0 (#92) #118

Bump golang.org/x/crypto from 0.37.0 to 0.45.0 (#92)

Bump golang.org/x/crypto from 0.37.0 to 0.45.0 (#92) #118

Workflow file for this run

name: Docker Image
on:
push:
branches:
- main
tags:
- 'v*'
paths:
- Dockerfile
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/docker.yml'
pull_request:
branches:
- main
paths:
- Dockerfile
- '**.go'
- 'go.mod'
- 'go.sum'
workflow_dispatch:
env:
IMAGE_NAME: mdeous/plasmid
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- name: Log into GitHub container registry
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: ghcr.io
username: mdeous
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get plasmid version
id: get_version
run: |
version=""
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
version="nightly"
else
version="$(make version)"
fi
echo "Version: ${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
with:
install: true
- name: Pull latest image
run: docker pull ghcr.io/${IMAGE_NAME}:latest
continue-on-error: true
- name: Build image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
pull: true
push: false
cache-from: ghcr.io/${{ env.IMAGE_NAME }}:latest
tags: ${{ env.IMAGE_NAME }}:ci
outputs: type=docker,dest=/tmp/image.tar
build-args: "VERSION=${{ steps.get_version.outputs.version }}"
- name: Upload image archive
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
with:
name: plasmid-image
path: /tmp/image.tar
publish:
name: Publish
needs: build
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
matrix:
registry:
- ghcr.io
- docker.io
include:
- registry: ghcr.io
secret: GITHUB_TOKEN
- registry: docker.io
secret: DOCKER_TOKEN
steps:
- name: Download image archive
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
with:
name: plasmid-image
path: /tmp/
- name: Import image
run: docker load --input /tmp/image.tar
- name: Log into Docker registry
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: ${{ matrix.registry }}
username: mdeous
password: ${{ secrets[matrix.secret] }}
- name: Get image version
id: get_version
run: |
version=""
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
version="latest"
else
version="${GITHUB_REF##*/}"
fi
echo "Image version: ${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Tag image
run: docker tag ${IMAGE_NAME}:ci ${{ matrix.registry }}/${IMAGE_NAME}:${IMAGE_VERSION}
env:
IMAGE_VERSION: ${{ steps.get_version.outputs.version }}
- name: Tag latest image
if: ${{ steps.get_version.outputs.version }} != 'latest'

Check warning on line 142 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / Docker Image

Workflow syntax warning

.github/workflows/docker.yml (Line: 142, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
run: docker tag ${IMAGE_NAME}:ci ${{ matrix.registry }}/${IMAGE_NAME}:latest
- name: Push image to container registry
run: docker push ${{ matrix.registry }}/${IMAGE_NAME}:${IMAGE_VERSION}
env:
IMAGE_VERSION: ${{ steps.get_version.outputs.version }}
- name: Push latest image to container registry
if: ${{ steps.get_version.outputs.version }} != 'latest'

Check warning on line 151 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / Docker Image

Workflow syntax warning

.github/workflows/docker.yml (Line: 151, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
run: docker push ${{ matrix.registry }}/${IMAGE_NAME}:latest