Skip to content

Commit

Permalink
first test on workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Kelley committed Apr 6, 2021
1 parent dca3811 commit 4a48c6d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release-containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release Containers

on:
push:
tags: [ 'v*' ]


jobs:
release-containers:
name: Build and Push
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Login to ghcr.io Docker registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compute Docker container image addresses
run: |
DOCKER_REPOSITORY="ghcr.io/${GITHUB_REPOSITORY,,}"
DOCKER_TAG="${GITHUB_REF:11}"
echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_ENV
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
echo "Using: ${DOCKER_REPOSITORY}/*:${DOCKER_TAG}"
- name: 'Pull latest existing Docker container image: server'
run: docker pull "${DOCKER_REPOSITORY}/server:latest" || true

- name: 'Build Docker container image: server'
run: |
docker build \
--cache-from "${DOCKER_REPOSITORY}/server:latest" \
--tag "${DOCKER_REPOSITORY}/server:latest" \
--tag "${DOCKER_REPOSITORY}/server:${DOCKER_TAG}" \
.
- name: Push Docker container image server:latest"
run: docker push "${DOCKER_REPOSITORY}/server:latest"

- name: Push Docker container image server:v*"
run: docker push "${DOCKER_REPOSITORY}/server:${DOCKER_TAG}"

0 comments on commit 4a48c6d

Please sign in to comment.