Skip to content

Commit

Permalink
Merge pull request #41 from vechain/39-fix-update-buildanddeploy-runner
Browse files Browse the repository at this point in the history
chore: update and fix actions
  • Loading branch information
akanoce authored Jan 5, 2024
2 parents 18eb3e6 + 4972a28 commit a841fae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy to GH page
name: Build and Deploy to GH pages

on:
push:
Expand All @@ -9,6 +9,11 @@ jobs:
BuildAndDeploy:
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
38 changes: 16 additions & 22 deletions .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
branches:
- master

env:
REGISTRY: ghcr.io
IMAGE_NAME: vechain/insight-app
jobs:
build:
env:
REGISTRY: ghcr.io
IMAGE_NAME: vechain/insight-app
publish:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -22,23 +22,17 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download artifact explorer
uses: actions/download-artifact@v2
with:
name: insight-app
path: /tmp
- name: Load Docker images
run: |
docker load --input /tmp/insight-app.tar
docker image ls -a

- name: Tags images to publish
run: |
timestamp=`date +%s`
docker tag insight-app ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${timestamp}
docker tag insight-app ${{env.REGISTRY}}/${{env.IMAGE_NAME}}
docker tag insight-app ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{github.sha}}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Publish images
run: |
docker push -a ${{env.REGISTRY}}/${{env.IMAGE_NAME}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit a841fae

Please sign in to comment.