Skip to content

Commit

Permalink
Update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Oct 6, 2023
1 parent f5218dc commit 94462c4
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: tests (pfcon)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Start Docker Swarm
run: docker swarm init --advertise-addr 127.0.0.1
- name: Build and run tests
Expand All @@ -30,9 +30,9 @@ jobs:
name: tests (CUBE)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: docker build -t localhost/fnndsc/pfcon .
- uses: FNNDSC/cube-integration-action@v6
- uses: FNNDSC/cube-integration-action@master
env:
PFCON_IMAGE: localhost/fnndsc/pfcon

Expand All @@ -41,23 +41,15 @@ jobs:
if: github.event_name == 'push' || github.event_name == 'release'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Get build version
id: version
run: |
desc="$(git describe --tags)"
echo "Version=$desc"
echo "::set-output name=desc::$desc"
- name: Get build tags
id: info
shell: python
run: |
import os
import datetime
import itertools
import subprocess as sp
short_sha = os.getenv('GITHUB_SHA', 'unknown')[:7]
git_refs = []
Expand All @@ -72,39 +64,32 @@ jobs:
[repo],
(':' + t for t in tags)
))
print(f'::set-output name=tags::{names}')
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
id: buildx
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
with open(os.environ['GITHUB_OUTPUT'], 'a') as out:
out.write(f'tags={names}\n')
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
build-args: |
ENVIRONMENT=production
BUILD_VERSION=${{ steps.version.outputs.desc }}
BUILD_VERSION=${{ github.ref_name }}
push: true
context: .
file: ./Dockerfile
tags: "${{ steps.info.outputs.tags }}"
platforms: linux/amd64,linux/ppc64le,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 94462c4

Please sign in to comment.