Skip to content

Commit

Permalink
fix(gha): copy contents not dir itself
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Nov 11, 2023
1 parent e94176f commit 4294df9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
user: hey
key: ${{ secrets.PRIVATE_KEY }}
src: './public'
src: './public/'
project: "pgs-${{ steps.vars.outputs.sha_short }}"
promote: "pgs-prod"
retain: "pgs-"
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
user: hey
key: ${{ secrets.PRIVATE_KEY }}
src: './public'
src: './public/'
project: "git-pico-${{ steps.vars.outputs.sha_short }}"
promote: "git-pico"
retain: "git-pico-"
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ pgs-site:
.PHONY: pgs-site

pgs-deploy: pgs-static pgs-site
scp -R ./public/* [email protected]:/pgs-local
# rsync -rv -e "ssh -p 2222" ./public/ erock@localhost:/pgs-local
rsync -rv ./public/ [email protected]:/pgs-local
ssh [email protected] link pgs-prod pgs-local --write
.PHONY: pgs-site-deploy

Expand Down
6 changes: 4 additions & 2 deletions pgs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ func assetHandler(w http.ResponseWriter, h *AssetHandler) {
var contents utils.ReaderAtCloser
assetFilepath := ""
status := 200
attempts := []string{}
for _, fp := range routes {
attempts = append(attempts, fp.Filepath)
c, _, _, err := h.Storage.GetFile(bucket, fp.Filepath)
if err == nil {
contents = c
Expand All @@ -243,9 +245,9 @@ func assetHandler(w http.ResponseWriter, h *AssetHandler) {

if assetFilepath == "" {
h.Logger.Infof(
"asset not found in bucket: bucket:[%s], file:[%s]",
"asset not found in bucket: bucket:[%s], routes:[%s]",
bucket.Name,
h.Filepath,
strings.Join(attempts, ", "),
)
http.Error(w, "404 not found", http.StatusNotFound)
return
Expand Down

0 comments on commit 4294df9

Please sign in to comment.