Skip to content

Commit

Permalink
Merge pull request #17 from medyagh/az_blob
Browse files Browse the repository at this point in the history
upload PR binaries to azure
  • Loading branch information
medyagh authored Dec 23, 2020
2 parents 3ce8ae5 + eacfc89 commit 13a2d47
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
pull_request:
paths:
- "**.go"
- "**.yml"
push:
branches:
- master
name: Build PR
jobs:
build:
name: Build binaries
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Fetch Git Tags
run: |
git fetch --prune --unshallow --tags
- name: Get SHORT SHA
id: shortsha
run: |
echo "::set-output name=sha8::$(echo ${{github.event.pull_request.head.sha}} | cut -c1-8)"
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: '1.14.6'
stable: true
id: go
- name: install rice
run: |
go get github.com/GeertJohan/go.rice
go get github.com/GeertJohan/go.rice/rice
- name: Cross Platform Build
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make cross
- name: Test
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make test
- uses: LanceMcCarthy/[email protected]
name: Uploading to Azure storage...
with:
connection_string: ${{ secrets.az_connection_string }}
container_name: gopogh
source_folder: ./out
destination_folder: ${{github.event.number}}/${{ steps.shortsha.outputs.sha8 }}
clean_destination_folder: true
fail_if_source_empty: true
- name: Report url
shell: bash
run: |
echo "*******************************************************"
echo "https://gopogh.blob.core.windows.net/gopogh/${{github.event.number}}/${{ steps.shortsha.outputs.sha8 }}/output.html"
echo "https://gopogh.blob.core.windows.net/gopogh/${{github.event.number}}/${{ steps.shortsha.outputs.sha8 }}/output.html"
echo "*******************************************************"
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Fetch Git Tags
run: |
git fetch --prune --unshallow --tags
- name: Set up Go
uses: actions/setup-go@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ test-in-docker:
rm ./testdata/docker-test/testout.html || true
docker run -it -e NAME="${JOB_NAME} ${GITHUB_REF}" -e REPO="${GITHUB_REPOSITORY}" -e DETAILS="${GITHUB_SHA}" -v $(CURDIR)/testdata/docker-test:/data local/gopogh ./text2html.sh

.PHONY: azure_blob_connection_string
azure_blob_connection_string: ## set this env export AZURE_STORAGE_CONNECTION_STRING=$(az storage account show-connection-string -n $AZ_STORAGE -g $AZ_RG --query connectionString -o tsv)
az storage account show-connection-string -n ${AZ_STORAGE} -g ${AZ_RG} --query connectionString -o tsv

0 comments on commit 13a2d47

Please sign in to comment.